-1
    please anybody help to fix this issue?<br/>
    **I am getting issue [client] - AMQ214008: Failed to handle packet java.lang.UnsupportedOperationException while processing the command data in javalite async?**<br/>

            [2018-03-30 10:27:16,303] - [DEBUG] [client] - Calling close on session ClientSessionImpl [name=d13aa760-33d6-11e8-b4fb-844bf530b8f3, username=null, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@58e64301, metaData=(jms-session=,)]@6a6c5fb3 <br/>
            [2018-03-30 10:27:16,306] - [DEBUG] [server] - QueueImpl[name=jms.queue.eventQueue, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=70d74287-3283-11e8-8a66-844bf530b8f3]]@39533a61 doing deliver. messageReferences=0 <br/>
            [2018-03-30 10:27:16,308] - [DEBUG] [client] - calling cleanup on ClientSessionImpl [name=d13aa760-33d6-11e8-b4fb-844bf530b8f3, username=null, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@58e64301, metaData=(jms-session=,)]@6a6c5fb3 <br/>
            [2018-03-30 10:27:16,335] - [DEBUG] [HttpAsyncRequestExecutor] - http-outgoing-0 [ACTIVE] [content length: 42355; pos: 42355; completed: true] <br/>
            [2018-03-30 10:27:16,336] - [DEBUG] [ThreadLocalRandom] - -Dio.netty.initialSeedUniquifier: 0xad1a1d5891abf66a <br/>
            **[2018-03-30 10:27:16,337] - [ERROR] [client] - AMQ214008: Failed to handle packet <br/>
            java.lang.UnsupportedOperationException<br/>
            at java.nio.ByteBuffer.array(Unknown Source)**<br/>
            at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.handleCompressedMessage(ClientConsumerImpl.java:600)<br/>
            at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.handleMessage(ClientConsumerImpl.java:532)<br/>
            at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.handleReceiveMessage(ClientSessionImpl.java:824)<br/>
            at org.apache.activemq.artemis.spi.core.remoting.SessionContext.handleReceiveMessage(SessionContext.java:97)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.handleReceivedMessagePacket(ActiveMQSessionContext.java:712)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.access$400(ActiveMQSessionContext.java:111)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext$ClientSessionPacketHandler.handlePacket(ActiveMQSessionContext.java:755)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:594)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:368)<br/>
            at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:350)<br/>
            at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1140)<br/>
            at org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:183)<br/>
            at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:100)<br/>
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)<br/>
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)<br/>
            at java.lang.Thread.run(Unknown Source)<br/>
               <br/><br/>            

When i execute the code in standalone project, its working fine. But while running the same in Tomcat server its throwing the above error..?


Source Code is below public class TestCommand extends Command { private TestEvent event;

          public TestCommand(MsgEvent event) 
          {
          this.event = (TestEvent)event;
          }

          public TestCommand() 
          {
          } 

          @Override
          public void execute() 
          {   
              //code stuff
          }

      }
      <br/><br/>          
      async = new Async(filePath, false, new QueueConfig("eventQueue", new CommandListener(), threadCount));
          <br/>
      async.start();
      <br/>
      public void test(EventCommand ev)
      {
          async.send("eventQueue", ev);
      }       <br/>

Following libraries are loaded into classpath

please anybody help to fix this issue?

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
  • Obviously you have some sort of a class path issue with libraries loaded in Tomcat. I added Artemis related tags so that the Artemis team takes notice. If you are using Maven, you might want to use a Maven dependency plugin to investigate classpath conflicts: https://maven.apache.org/plugins/maven-dependency-plugin/plugin-info.html – ipolevoy Mar 30 '18 at 15:48
  • we are not using maven and directly added the dependent jars in classpath. following libraries are loaded artemis-commons-1.2.0.jar artemis-core-client-1.2.0.jar artemis-jms-client-1.2.0.jar artemis-jms-server-1.2.0.jar artemis-journal-1.2.0.jar artemis-selector-1.2.0.jar artemis-server-1.2.0.jar javax.jms-api-2.0.jar netty-all-4.1.7.Final.jar xmlpull-1.1.3.1.jar xpp3_min-1.1.4c.jar xstream-1.4.7.jar javalite-async-1.14-20160920.063953-45.jar javalite-common-1.4.14.j7-20180227.053758-4.jar – NarendraBabu Ravi Mar 30 '18 at 15:52
  • that was a suggestion, you still need to figure out the conflict on your classpath, or refer to https://activemq.apache.org/artemis/community.html. In other words, this is not a JavaLite issue. – ipolevoy Mar 30 '18 at 15:53
  • @ipolevoy: Artemis 2.5 version supported by which version of javalite async and jdk? – NarendraBabu Ravi Mar 30 '18 at 17:44
  • Please, see https://github.com/javalite/activeweb/blob/master/javalite-async/pom.xml#L17 and: https://github.com/javalite/activeweb/blob/master/pom.xml#L50 – ipolevoy Mar 30 '18 at 21:33
  • Also, the JavaLite version 1.14 is very old, upgrade to 2.0 – ipolevoy Mar 30 '18 at 21:34
  • @ipolevoy: thanks for the update – NarendraBabu Ravi Apr 01 '18 at 15:48

1 Answers1

1

The evidence suggests to me that when this code is executed in Tomcat it is using a different java.nio.ByteBuffer implementation than when it is run standalone (perhaps due to different versions of Netty). The code causing the exception is calling java.nio.ByteBuffer.array() which is not required to be implemented (i.e. throwing an UnsupportedOperationException is valid here). This was dealt with in Artemis via this commit which is available in Artemis 1.4. That said, there's no reason to use such an old version of Artemis. I would recommend you upgrade to the latest 2.5 release as soon as possible.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Thank you very much justin, its problem with netty version. after downgrading the netty version to netty-all-4.0.32.Final from netty-all-4.1.7.Final, this error is fixed – NarendraBabu Ravi Mar 30 '18 at 17:56
  • Can you vote the answer up since it proved correct? Also, I would still recommend you upgrade ASAP. – Justin Bertram Mar 30 '18 at 18:00
  • @JustinBertram, JavaLite pulls Artemis version 2.3: https://github.com/javalite/activeweb/blob/master/javalite-async/pom.xml#L17. Somehow he swapped it for the older version – ipolevoy Mar 30 '18 at 21:32
  • Thanks JustinBertram and ipolevoy for your time. we are using jdk 1.7,it seems the corresponding javalite async jars version 1.14. I think even we have to change jdk to 1.8 for using latest version of javallite and Artemis. :-) – NarendraBabu Ravi Mar 31 '18 at 14:36
  • Seeing that updates for Java 7 haven't been publicly available since early 2015 I'd say you're probably due for an upgrade there as well. – Justin Bertram Apr 02 '18 at 00:24