Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2922

artemis-cli consumer on large message results in a ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.15.0, 2.16.0
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Description

      When i try to consume a Large Message (stored in ../data/large-messages)  with the artemis-cli

      artemis consumer --message-count 1 --data export-test.xml --destination queue://test

      i get an ClassCastException output

      Connection brokerURL = tcp://localhost:61616

      Consumer:: filter = null

      Consumer ActiveMQQueue[test], thread=0 wait until 1 messages are consumed

      java.lang.RuntimeException: java.lang.ClassCastException: class org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl cannot be cast to class org.apache.activemq.artemis.core.server.LargeServerMessage (org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl and org.apache.activemq.artemis.core.server.LargeServerMessage are in unnamed module of loader java.net.URLClassLoader @18769467)

      at org.apache.activemq.artemis.cli.factory.serialize.XMLMessageSerializer.write(XMLMessageSerializer.java:74)

      at org.apache.activemq.artemis.cli.commands.messages.Consumer$SerialiserMessageListener.onMessage(Consumer.java:140)

      at org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.handle(ConsumerThread.java:73)

      at org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.consume(ConsumerThread.java:192)

      at org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.run(ConsumerThread.java:67)

      Caused by: java.lang.ClassCastException: class org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl cannot be cast to class org.apache.activemq.artemis.core.server.LargeServerMessage (org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl and org.apache.activemq.artemis.core.server.LargeServerMessage are in unnamed module of loader java.net.URLClassLoader @18769467)

      at org.apache.activemq.artemis.cli.commands.tools.xml.XMLMessageExporter.printMessageBody(XMLMessageExporter.java:61)

      at org.apache.activemq.artemis.cli.commands.tools.xml.XMLMessageExporter.printSingleMessageAsXML(XMLMessageExporter.java:53)

      at org.apache.activemq.artemis.cli.factory.serialize.XMLMessageSerializer.write(XMLMessageSerializer.java:72)

      ... 4 more

      Consumer ActiveMQQueue[test], thread=0 Consumed: 0 messages

      Consumer ActiveMQQueue[test], thread=0 Consumer thread finished

      Yet, the message was consumed from the queue!

      Also a workaround/fix for exporting Large Messages would be great.

        Attachments

        1. large-test.xml.sav
          54 kB
          Oliver Scholz

          Activity

            People

            • Assignee:
              clebertsuconic Clebert Suconic
              Reporter:
              scholzol-it2m Oliver Scholz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: