Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-7245

ActiveMQ is throwing ClassCastExceptions inside the client library

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.14.5, 5.15.9
    • None
    • JMS client
    • None

    Description

      Our JMS exception listener is receiving the following exceptions when trying to connect to an ActiveMQ instance, because of an usafe cast in org.apache.activemq.openwire.v12.MessageMarshaller.java:

      https://github.com/apache/activemq/blob/master/activemq-client/src/main/java/org/apache/activemq/openwire/v12/MessageMarshaller.java#L75

       

      Connection error: javax.jms.JMSException: Unexpected error occurred: java.lang.ClassCastException: org.apache.activemq.command.BrokerId cannot be cast to org.apache.activemq.command.ConsumerId

      javax.jms.JMSException: Unexpected error occurred: java.lang.ClassCastException: org.apache.activemq.command.BrokerId cannot be cast to org.apache.activemq.command.ConsumerId

            at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54)

            at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1949)

            at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1968)

            at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)

            at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:126)

            at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)

            at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114)

            at org.apache.activemq.transport.WireFormatNegotiator.onException(WireFormatNegotiator.java:173)

            at org.apache.activemq.transport.AbstractInactivityMonitor.onException(AbstractInactivityMonitor.java:344)

            at org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)

            at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:224)

            at java.lang.Thread.run(Thread.java:748)

      Caused by: java.io.IOException: Unexpected error occurred: java.lang.ClassCastException: org.apache.activemq.command.BrokerId cannot be cast to org.apache.activemq.command.ConsumerId

            at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:222)

            ... 1 more

      Caused by: java.lang.ClassCastException: org.apache.activemq.command.BrokerId cannot be cast to org.apache.activemq.command.ConsumerId

            at org.apache.activemq.openwire.v12.MessageMarshaller.tightUnmarshal(MessageMarshaller.java:75)

            at org.apache.activemq.openwire.v12.ActiveMQMessageMarshaller.tightUnmarshal(ActiveMQMessageMarshaller.java:66)

            at org.apache.activemq.openwire.v12.ActiveMQTextMessageMarshaller.tightUnmarshal(ActiveMQTextMessageMarshaller.java:66)

            at org.apache.activemq.openwire.OpenWireFormat.tightUnmarshalNestedObject(OpenWireFormat.java:456)

            at org.apache.activemq.openwire.v12.BaseDataStreamMarshaller.tightUnmarsalNestedObject(BaseDataStreamMarshaller.java:125)

            at org.apache.activemq.openwire.v12.MessageDispatchMarshaller.tightUnmarshal(MessageDispatchMarshaller.java:71)

            at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:365)

            at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:278)

            at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)

            at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)

            at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)

            ... 1 more

      Conection error: javax.jms.JMSException: Unexpected error occurred: java.lang.ClassCastException: org.apache.activemq.command.BrokerId cannot be cast to org.apache.activemq.command.ConsumerId

      Attachments

        1. Screen Shot 2019-07-28 at 23.23.00.png
          934 kB
          Christian Müller

        Issue Links

          Activity

            People

              Unassigned Unassigned
              muellerc Christian Müller
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: