Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

638
Visualizações
Serializable class not available to broker: java.lang.ClassNotFoundException while viewing messages in ActiveMQ

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?

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

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.

about 4 years ago · Santiago Trujillo Relatório

0

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

You might encounter the below exception after updating the above property

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

In order to fix it, set the wrapper.java.additional.13 property to -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="<choose_the_packages_set_it_here>"

You could also use -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*" as the value, however it might be unsafe to use wildcard.

This worked for me!! Hope it helps you

about 4 years ago · Santiago Trujillo Relatório

0

If you are sending class, in this case you will face this issue.

For example: customer is my class object and when you try to see the infomation it gives you error:
Serializable class not available to broker: java.lang.ClassNotFoundException while viewing messages in ActiveMQ

jmsTemplate.convertAndSend(jmsDestination,customer);

The Solution of this problem is ("toString()") method along with class.

Solution: jmsTemplate.convertAndSend(jmsDestination,customer.toString());
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda