[
https://issues.apache.org/jira/browse/CAMEL-11772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163003#comment-16163003
]
ASF GitHub Bot commented on CAMEL-11772:
----------------------------------------
GitHub user derekwilhelm opened a pull request:
https://github.com/apache/camel/pull/1932
CAMEL-11772 - Fix potential ClassCastException in SjmsMessage.java
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/derekwilhelm/camel CAMEL-11772
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1932.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1932
----
commit b9baeba2128d9ef6d67c4651033e982e6e945665
Author: derekwilhelm <[email protected]>
Date: 2017-09-12T14:19:06Z
CAMEL-11772 - Fix potential ClassCastException in SjmsMessage.java
----
> Sjms with Artemis causes NullPointerException due to a ClassCastException
> -------------------------------------------------------------------------
>
> Key: CAMEL-11772
> URL: https://issues.apache.org/jira/browse/CAMEL-11772
> Project: Camel
> Issue Type: Bug
> Components: camel-sjms
> Affects Versions: 2.19.0, 2.19.1, 2.19.2
> Reporter: Derek Wilhelm
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> When using a camel-sjms endpoint with an Apache Artemis broker, the sjms
> endpoint will throw a NullPointerException in the
> org.apache.camel.component.sjms.consumer.AbstractMessageHandler.onMessage
> method. However, this exception is actually masking the real exception
> within sjms. In SjmsMessage.java the method getDestinationAsString gets
> called with a javax.jms.Destination object. In this case, it is a
> org.apache.activemq.artemis.jms.client.ActiveMQDestination. The
> ActiveMQDestination is neither a javax.jms.Topic nor a javax.jms.Queue. In
> the getDestinationAsString method in SjmsMessage.java, it first checks to see
> if the destination is a Topic and then if it is not it blindly casts to a
> javax.jms.Queue and in this case causes a ClassCastException.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)