Serializable class not available to broker: java.lang.ClassNotFoundException while viewing messages in ActiveMQ

OwlR picture OwlR · Mar 30, 2017 · Viewed 8.6k times · Source

I want to see content of message which have been queued in ActiveMQ queues. I opened web-console.(http://localhost:8161/admin/queues.jsp) and clicked on message-id of the message of queue. It gives me following error in "Message Details" window rather than giving content of message.

"javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException:"

What is the cause of this exception & what I need to do to get rid of this?

Answer

chim picture chim · Jul 17, 2017

I have seen this same error using ActiveMQ version 5.8.0

In my case it was a red herring, the ActiveMQ console could not unserialize the message it mustn't have access to the jar that the class is in, but the consumer application does, and the message is passed on without issue from the queue to the consumer.

I'd be interested to see if there's a solution to the issue here (viewing the message in the console), and also how this is handled in more recent versions of ActiveMQ.