0 Replies Latest reply on Apr 18, 2013 6:13 AM by Mike Smiteas

    HornetQ JMS exception using webstart

    Mike Smiteas Newbie

      Hi all together,

       

      i have a strange behavior when using remote hornetq messaging. I am using JBoss 7.1.3.Final and a swing client.

      If i launch my client, connecting to the hornetq system via eclipse everything works fine. If i launch the application via webstart, i get the following exception:

       

       

      18.04.2013 10:02:01 org.hornetq.core.protocol.core.impl.RemotingConnectionImpl bufferReceived
      ERROR: HQ214036: Failed to decode packet
      java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 67
          at org.jboss.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)
          at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readNullableString(ChannelBufferWrapper.java:54)
          at org.hornetq.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V2.decodeRest(ClusterTopologyChangeMessage_V2.java:140)
          at org.hornetq.core.protocol.core.impl.PacketImpl.decode(PacketImpl.java:260)
          at org.hornetq.core.protocol.ClientPacketDecoder.decode(ClientPacketDecoder.java:68)
          at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:485)
          at org.hornetq.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1658)
          at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:72)
          at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
          at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787)
          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:281)
          at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.decode(HornetQFrameDecoder2.java:169)
          at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134)
          at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)
          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
          at org.jboss.netty.channel.socket.oio.OioWorker.process(OioWorker.java:71)
          at org.jboss.netty.channel.socket.oio.AbstractOioWorker.run(AbstractOioWorker.java:73)
          at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:51)
          at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
          at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
          at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:175)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      

       

      Here are some of my config/code:

       

      Server messaging subsystem:

       

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.2">
              
      <hornetq-server>
                  
      <security-enabled>false</security-enabled>
              
      
                  
      <persistence-enabled>true</persistence-enabled>
                  
      <journal-file-size>102400</journal-file-size>
                  
      <journal-min-files>2</journal-min-files>
      
      
                  
      <connectors>
                      
      <netty-connector name="netty" socket-binding="messaging"/>
                      
      <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                          
      <param key="batch-delay" value="50"/>
                      
      </netty-connector>
                      
      <in-vm-connector name="in-vm" server-id="0"/>
                  
      </connectors>
      
      
                  
      <acceptors>
                      
      <netty-acceptor name="netty" socket-binding="messaging"/>
                      
      <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                          
      <param key="batch-delay" value="50"/>
                          
      <param key="direct-deliver" value="false"/>
                      
      </netty-acceptor>
                      
      <in-vm-acceptor name="in-vm" server-id="0"/>
                  
      </acceptors>
      
      
                  
      <address-settings>
                      
      <address-setting match="#">
                          
      <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                          
      <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                          
      <redelivery-delay>0</redelivery-delay>
                          
      <max-size-bytes>10485760</max-size-bytes>
                          
      <address-full-policy>BLOCK</address-full-policy>
                          
      <message-counter-history-day-limit>10</message-counter-history-day-limit>
                      
      </address-setting>
                  
      </address-settings>
      
      
                  
      <jms-connection-factories>
                      
      <connection-factory name="InVmConnectionFactory">
                          
      <connectors>
                              
      <connector-ref connector-name="in-vm"/>
                          
      </connectors>
                          
      <entries>
                              
      <entry name="java:/ConnectionFactory"/>
                          
      </entries>
                      
      </connection-factory>
                      
      <connection-factory name="RemoteConnectionFactory">
                          
      <connectors>
                              
      <connector-ref connector-name="netty"/>
                          
      </connectors>
                          
      <entries>
                              
      <entry name="RemoteConnectionFactory"/>
                              
      <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                          
      </entries>
                      
      </connection-factory>
                      
      <pooled-connection-factory name="hornetq-ra">
                          
      <transaction mode="xa"/>
                          
      <connectors>
                              
      <connector-ref connector-name="in-vm"/>
                          
      </connectors>
                          
      <entries>
                              
      <entry name="java:/JmsXA"/>
                          
      </entries>
                      
      </pooled-connection-factory>
                  
      </jms-connection-factories>
      
      
                  
      <jms-destinations>
                      
      <jms-topic name="MyMessaging">
                          
      <entry name="topic/MyMessaging"/>
                          
      <entry name="java:jboss/exported/jms/topic/MyMessaging"/>
                      
      </jms-topic>
                  
      </jms-destinations>
              
      </hornetq-server>
          
      </subsystem>
      

       

      Client code:

       

       

      final Map<String, Object> connectionParams = new HashMap<String, Object>();
      connectionParams.put(TransportConstants.HOST_PROP_NAME, "localhost");
      connectionParams.put(TransportConstants.PORT_PROP_NAME, 5445);
       
      final TransportConfiguration transportConfiguration = new TransportConfiguration(
      NettyConnectorFactory.class.getName(), connectionParams);
       
      final TopicConnectionFactory cf = (TopicConnectionFactory) HornetQJMSClient
      .createConnectionFactoryWithoutHA(JMSFactoryType.TOPIC_CF, transportConfiguration);
       
      topicConnection = cf.createTopicConnection();
       
      topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
       
      topic = topicSession.createTopic("MyMessaging");
       
      topicConnection.start();
      
      subscriber = topicSession.createSubscriber(topic);
      
      subscriber.setMessageListener(new MessageListenerImpl());
      

       

      I don't see the difference in the both execution environments.

      Hope, anyone can help,

      Mike