Este conteúdo não está disponível no idioma selecionado.
Chapter 4. Apache ActiveMQ Issues
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.