MarshallingSupport.unmarshalPrimitive is throwing "Unknown primitive type: 0" when nested map contains a null

Solution Verified - Updated -

Environment

  • Fuse Message Broker 5.0

Issue

MarshallingSupport.unmarshalPrimitive is throwing "Unknown primitive type: 0" when nested map contains a null

94: 10.86.140.12: Oct 24 2007 12:11:29.537 -0400: %XXXX-EXCEPTION:
javax.jms.JMSException: Unknown primitive type: 0
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.command.ActiveMQMapMessage.loadContent(ActiveMQMapMessage.java:160)
at org.apache.activemq.command.ActiveMQMapMessage.initializeReading(ActiveMQMapMessage.java:723)
at org.apache.activemq.command.ActiveMQMapMessage.getMapNames(ActiveMQMapMessage.java:478)

When migrating from ActiveMQ 4 to ActiveMQ 5 "Unknown primitve type:0" error is thrown.

Resolution

This problem is fixed in ActiveMQ 5.0.0.5-fuse and later.

Root Cause

When this message is marshalled it goes though MarshallingSupport.marshalPrimitiveMap(). MarshalPrimitiveMap is called recursively to marshall the nested Map calling marshalPrimitive on each entry in the map. If one of the values in the nested Map is null it is marshalled properly by the first case in the switch statement of MarshallingSupport.marshalPrimitive().

MB-261

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.