Ce contenu n'est pas disponible dans la langue sélectionnée.

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.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.