Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11772

Sjms with Artemis causes NullPointerException due to a ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.19.0, 2.19.1, 2.19.2
    • Fix Version/s: 2.18.5, 2.19.4, 2.20.0
    • Component/s: camel-sjms
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                wilhelmd Derek Wilhelm
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified