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

Clebert Suconic commented on ARTEMIS-2922:
------------------------------------------

I guess you should first explain exactly what you're doing.. how you are 
generating the data, exporting and importing.

 

 

the consumer and producer are definitely test tools for you to validate your 
queue.. we can fix it.. but the way you should consume and produce to the queue 
is through you application.

> artemis-cli consumer on large message results in a ClassCastException
> ---------------------------------------------------------------------
>
>                 Key: ARTEMIS-2922
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2922
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: ActiveMQ-Artemis-Native
>    Affects Versions: 2.15.0
>         Environment: OS: Ubuntu 20.04 lts
> jre/jdk: openjdk version "11.0.8" 2020-07-14
> The broker has been created with
> {quote}bin/artemis create --user admin --password admin --allow-anonymous 
> broker
> {quote}
> (no changes in the config)
> The message is produced with
> {quote}artemis producer --data large-test.xml.sav --destination queue://test
> {quote}
>  
>            Reporter: Oliver Scholz
>            Assignee: Clebert Suconic
>            Priority: Major
>              Labels: ClassCastException, LargeMessage, artemis, cli, consumer
>         Attachments: large-test.xml.sav
>
>
> When i try to consume a Large Message (stored in ../data/large-messages)  
> with the artemis-cli
> {quote}{color:#000000}artemis consumer --message-count 1 --data 
> export-test.xml --destination queue://test{color}
> {quote}
> i get an ClassCastException output
> {quote}{color:#000000}Connection brokerURL = tcp://localhost:61616{color}
> {color:#000000}Consumer:: filter = null{color}
> {color:#000000}Consumer ActiveMQQueue[test], thread=0 wait until 1 messages 
> are consumed{color}
> {color:#000000}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){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.factory.serialize.XMLMessageSerializer.write(XMLMessageSerializer.java:74){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.messages.Consumer$SerialiserMessageListener.onMessage(Consumer.java:140){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.handle(ConsumerThread.java:73){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.consume(ConsumerThread.java:192){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.messages.ConsumerThread.run(ConsumerThread.java:67){color}
> {color:#000000}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){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.tools.xml.XMLMessageExporter.printMessageBody(XMLMessageExporter.java:61){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.commands.tools.xml.XMLMessageExporter.printSingleMessageAsXML(XMLMessageExporter.java:53){color}
> {color:#000000} at 
> org.apache.activemq.artemis.cli.factory.serialize.XMLMessageSerializer.write(XMLMessageSerializer.java:72){color}
> {color:#000000} ... 4 more{color}
> {color:#000000}Consumer ActiveMQQueue[test], thread=0 Consumed: 0 
> messages{color}
> {color:#000000}Consumer ActiveMQQueue[test], thread=0 Consumer thread 
> finished{color}
> {quote}
> Yet, the message was consumed from the queue!
> Also a workaround/fix for exporting Large Messages would be great.



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

Reply via email to