[ 
https://issues.apache.org/jira/browse/ARTEMIS-2551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16973486#comment-16973486
 ] 

Justin Bertram edited comment on ARTEMIS-2551 at 11/13/19 4:19 PM:
-------------------------------------------------------------------

This is happening because the JMS bridge is translating a foreign message 
implementation to an ActiveMQ Artemis message implementation. During this 
process all the properties from the foreign message will be copied to the 
Artemis version. The Artemis code uses 
[{{javax.jms.Message.getPropertyNames()}}|https://docs.oracle.com/javaee/7/api/javax/jms/Message.html#getPropertyNames--]
 to identify the names of all the properties on the foreign message and then 
uses those names to invoke {{javax.jms.Message.getObjectProperty()}} to get the 
property's value.

In your case the code encounters a property named {{JMSXGroupSeq}}. The code 
then tries to get the value of this property from the foreign message and set 
it on the Artemis implementation. It fails because the value of 
{{JMSXGroupSeq}} in the foreign message is {{null}}. Section 3.5.9 of both the 
JMS 2.0 & 1.1 specifications indicate that the {{JMSXGroupSeq}} property is of 
type {{int}}. An {{int}} is a primitive type and therefore should not be 
{{null}}. Based on this I'd say that the foreign message implementation you're 
using is not compliant with the JMS specification.

To be clear, this situation is different from the linked issue ARTEMIS-1874 
because that issue dealt with {{JMSXGroupId}} and {{JMSXUserId}} which are both 
defined in the specification as {{String}} types (which can be {{null}}).


was (Author: jbertram):
This is happening because the JMS bridge is translating a foreign message 
implementation to an ActiveMQ Artemis message implementation. During this 
process all the properties from the foreign message will be copied to the 
Artemis version. The Artemis code uses 
[{{javax.jms.Message.getPropertyNames()}}|https://docs.oracle.com/javaee/7/api/javax/jms/Message.html#getPropertyNames--]
 to identify the names of all the properties on the foreign message and then 
uses those names to invoke {{javax.jms.Message.getObjectProperty()}} to get the 
property's value.

In your case the code encounters a property named {{JMSXGroupSeq}}. The code 
then tries to get the value of this property from the foreign message and set 
it on the Artemis implementation. It fails because the value of 
{{JMSXGroupSeq}} in the foreign message is {{null}}. Section 3.5.9 of both the 
JMS 2.0 & 1.1 specifications indicate that the {{JMSXGroupSeq}} property is of 
type {{int}}. An {{int}} is a primitive type and therefore should not be 
{{null}}. Based on this I'd say that the foreign message implementation you're 
using is not compliant with the JMS specification.

> NPE in MessageUtil.setObjectProperty when name is 'JMSXGroupSeq'
> ----------------------------------------------------------------
>
>                 Key: ARTEMIS-2551
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2551
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.10.1
>            Reporter: Michael Szodorai
>            Priority: Critical
>
> {code:java}
>  java.lang.NullPointerException
> at java.base/java.util.Objects.requireNonNull(Objects.java:221)
> at 
> [email protected]//org.apache.activemq.artemis.reader.MessageUtil.getInteger(MessageUtil.java:267)
> at 
> [email protected]//org.apache.activemq.artemis.reader.MessageUtil.setObjectProperty(MessageUtil.java:258)
> at 
> [email protected]//org.apache.activemq.artemis.jms.client.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:702)
> at 
> [email protected]//org.apache.activemq.artemis.jms.client.ActiveMQMessage.<init>(ActiveMQMessage.java:296)
> at 
> [email protected]//org.apache.activemq.artemis.jms.client.ActiveMQBytesMessage.<init>(ActiveMQBytesMessage.java:88)
> at 
> [email protected]//org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.doSendx(ActiveMQMessageProducer.java:421)
> at 
> [email protected]//org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:222)
> at 
> [email protected]//org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.sendMessages(JMSBridgeImpl.java:1627)
> at 
> [email protected]//org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.sendBatchNonTransacted(JMSBridgeImpl.java:1460)
> at 
> [email protected]//org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.sendBatch(JMSBridgeImpl.java:1435)
> at 
> [email protected]//org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.access$1800(JMSBridgeImpl.java:77)
> at 
> [email protected]//org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl$SourceReceiver.run(JMSBridgeImpl.java:1829)
> at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to