Pesquisar

Este conteúdo não está disponível no idioma selecionado.

Chapter 4. Apache ActiveMQ Issues

download PDF

Abstract

JBoss A-MQ 6.2 uses Apache ActiveMQ 5.11.0. Since the last release, Apache ActiveMQ has been upgraded from version 5.9.0 to version 5.11.0. This introduces a few migration issues.

4.1. Key Migration Issues

JMS ObjectMessage serialization

If you are migrating an application that uses JMS ObjectMessage serialization (that is, sending or receiving messages containing a serialized Java object using the javax.jms.ObjectMessage type), in JBoss A-MQ 6.2.1 you must now set the org.apache.activemq.SERIALIZABLE_PACKAGES JVM property. The org.apache.activemq.SERIALIZABLE_PACKAGES property must be set to the list of Java packages that are allowed to be serialized.
For example, on the broker side, you can set this property in the InstallDir/etc/system.properties file, as follows:
org.apache.activemq.SERIALIZABLE_PACKAGES="java.lang,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper,com.mycompany.myapp"
If you do not set this JVM property, you are liable to see an error message like the following after migrating your application to JBoss A-MQ 6.2.1:
Caused by: javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class com.sundar.verify.MyBean! This class is not allowed to be serialized. Add package with 'org.apache.activemq.SERIALIZABLE_PACKAGES' system property.
Important
JMS ObjectMessage serialization poses significant security risks. If you use this feature, make sure that you understand the risks—see Security in Object Serialization.
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.