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

I want to see the contents of a message that has been queued in ActiveMQ queues. I opened the web console ( http: // localhost: 8161 / admin / queues.jsp ) and clicked on the message id in the queue. This gives me the following error in the Message Details window, rather than displaying the contents of the message.

"javax.jms.JMSException: Could not build the body from the contents. The serializable class is not accessible to the broker. Reason: java.lang.ClassNotFoundException:"

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

+6
source share
2 answers

I saw this same error using ActiveMQ version 5.8.0

In my case, it was a red herring , the ActiveMQ console could not fail to perform message arithmetic, it should not have access to the bank that the class is located, but the consumer application does, and the message is transmitted without problems from the queue for the consumer.

I would be interested to see if there is a solution to the problem (viewing the message in the console), as well as how this is handled in later versions of ActiveMQ.

+3
source

As OwIR mentioned, you need to set the path to the jar file containing the classes to property wrapper.java.classpath.3c %ACTIVEMQ_HOME%\bin\win64\wrapper.conf.

You may encounter the exception below after updating the above property

Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class

, wrapper.java.additional.13 -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="<choose_the_packages_set_it_here>"

-Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*" , .

! ,

0

Source: https://habr.com/ru/post/1673548/


All Articles