8

I am using SDL tridion object caching with ApacheMQ. I have deployed apachemq as a window service and it is running fine. During invalidation of messages I am getting the error below

2017-01-19 14:17:24,553 ERROR JMSCacheChannelConnector - JMS Exception occurred during reception of event. Attempting setting up JMS connectivity again
javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class com.tridion.cache.CacheEvent! This class is not trusted to be serialized as ObjectMessage payload. Please take a look at http://activemq.apache.org/objectmessage.html for more information on how to configure trusted classes.
    at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36) ~[activemq-client-5.14.3.jar:5.14.3]
    at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:208) ~[activemq-client-5.14.3.jar:5.14.3]
    at com.tridion.cache.JMSCacheChannelConnector.handleJmsMessage(JMSCacheChannelConnector.java:213) ~[cd_cache.jar:na]
    at com.tridion.cache.JMSCacheChannelConnector$2.onMessage(JMSCacheChannelConnector.java:84) [cd_cache.jar:na]
    at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1401) [activemq-client-5.14.3.jar:5.14.3]
    at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [activemq-client-5.14.3.jar:5.14.3]
    at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [activemq-client-5.14.3.jar:5.14.3]
    at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) [activemq-client-5.14.3.jar:5.14.3]
    at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) [activemq-client-5.14.3.jar:5.14.3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_80]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_80]

As per apachemq documentation "http://activemq.apache.org/objectmessage.html" I need to explicitly add the package to trusted list but i am not sure where I am suppose to add this entry in deployer.

  • Have you looked at article: activemq.apache.org/objectmessage.html – Hiren Kaku Jan 19 '17 at 18:12
  • Yes, I did and made the changes in mq side but i do not know what changes need to be made at deployer and CD side. I am not sure if there is any config which can be modified in deployer for mq settings or if we can do it in cd_storage – rdhaundiyal Jan 19 '17 at 18:50
  • Versions 5.12.2 and 5.13.0, ActiveMQ enforces users to explicitly whitelist packages that can be exchanged using ObjectMessages. We moved to version 5.11 which and it started working. – rdhaundiyal Jan 20 '17 at 12:45
  • @rdhaundiyal Sounds like you should answer your own question with that – Rob Stevenson-Leggett Jan 22 '17 at 10:07
  • But that is just a workaround. My java knowledge is quite limited but I am sure, I am missing some config through which version 5.13 will also start working. – rdhaundiyal Jan 22 '17 at 14:27
3

Apache ActiveMQ is blocking the JMS ObjectMessages for security reasons. This is the default configuration.

Configure ActiveMQ to allow ObjectMessages to be deserialized. Either enable it for all ObjectMessages or just for com.tridion.cache.CacheEvent.

Explanation and instructions are here: http://activemq.apache.org/objectmessage.html.

If you're running ActiveMQ on Windows then you can configure this in wrapper.conf.

wrapper.java.additional.13=-Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*"

Note:

The '13' in the above line may need changing, depending on your configuration. Look at the 'Java Additional Parameters' section in wrapper.conf.

Alternatively, To add this java argument -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*" in the micro services start up script.

0

We got the same issue with DXA Model service 2.0.2 (in-process) - even after configuring ActiveMQ by updating wrapper.conf and reinstalling ActiveMQ.

Following error was found in :cd_clientlog file (for model service)

2019-07-03 16:19:40,413 ERROR c.t.c.JMSCacheChannelConnector - JMS Exception occurred during reception of event. Attempting setting up JMS connectivity again 
javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: Forbidden class com.tridion.cache.CacheEvent! This class is not trusted to be serialized as ObjectMessage payload. Please take a look at http://activemq.apache.org/objectmessage.html for more information on how to configure trusted classes.

To resolve this issue, update InstallService.ps1 (of model service) and add java options as follows:

$jvmoptions = "-Xrs", "-Xms256m", "-Xmx512m", "-Dorg.apache.activemq.SERIALIZABLE_PACKAGES=""*"""

Uninstall and install Model service, JMSCacheChannelConnector error should not be there anymore.

(You can use prunmgr.exe to update javaoptions of already installed service, and restart the service)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.