3 Replies Latest reply on Nov 29, 2012 12:07 PM by jbertram

    JMS problem in JBoss 7.1.1

    a_torres

      Hi all,

       

      I'm facing problems with the JMS (HornetQ) server in JBoss 7.1.1. I try different configurations in the standalone.xml and ending testing it with the default one in standalone-full.xml, I found the error in any of them.

       

      For the client, I'm using the example I found in https://docs.jboss.org/author/display/AS71/JNDI+Reference It's as simple as:

       

       

      package stupid.tests;

       

      import java.util.Properties;

       

      import javax.naming.Context;

      import javax.naming.InitialContext;

      import javax.naming.NamingException;

       

      public class JMSTest

      {

       

       

        public static void main(String[] args)

        {

         

          final Properties props = new Properties();

          props.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName());

          props.put(Context.PROVIDER_URL, "remote://localhost:5445");

          try {

            Context context = new InitialContext(props);

          } catch (NamingException e) {

            e.printStackTrace();

          }

          System.out.println("END!");

       

        }

       

      }

       

       

      The server error is:

       

       

      14:07:22,209 ERROR [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (Old I/O server worker (parentId: 25503402, [id: 0x018526aa, /0.0.0.0:5445])) Failed to decode: java.lang.IllegalArgumentException: Invalid type: -1

              at org.hornetq.core.protocol.core.impl.PacketDecoder.decode(PacketDecoder.java:550) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:479) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73) [hornetq-core-2.2.13.Final.jar:]

              at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline$StaticChannelHandlerContext.sendUpstream(StaticChannelPipeline.java:534) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287) [netty-3.2.6.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.decode(HornetQFrameDecoder2.java:169) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134) [hornetq-core-2.2.13.Final.jar:]

              at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:367) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:100) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181) [netty-3.2.6.Final.jar:]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]

       

      and the client one is:

       

      03-ago-2012 14:07:16 org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.3.GA

      03-ago-2012 14:07:16 org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.3.GA

      03-ago-2012 14:07:16 org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.3.GA

      javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]

          at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

          at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

          at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

          at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

          at javax.naming.InitialContext.init(Unknown Source)

          at javax.naming.InitialContext.<init>(Unknown Source)

          at stupid.tests.JMSTest.main(JMSTest.java:20)

      Caused by: java.lang.RuntimeException: Operation failed with status WAITING

          at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)

          at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)

          at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

          at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

          at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

          ... 5 more

      END!

       

      Anyone can help me with this issue?

       

      Regards,

      Alvaro Torres

        • 1. Re: JMS problem in JBoss 7.1.1
          jbertram

          You're doing your JNDI lookup on a Netty port used by HornetQ (i.e. 5445) rather that on the JBoss Remoting 3 port used for JNDI (i.e. 4447).  Take a look at this quickstart for how to do it correctly.

          • 2. Re: JMS problem in JBoss 7.1.1
            hnqoliveira

            When I start the jboss to bind all interfaces and change the provider url to another address diferente of localhost the same error occurrs in the client.

             

            Jboss Start Command:

            ./standalone.sh -b 0.0.0.0 --server-config=standalone-full.xml

             

            HelloWorldJMSClient values:

                // Set up all the default values

                private static final String DEFAULT_MESSAGE = "Hello, World!";

                private static final String DEFAULT_CONNECTION_FACTORY = "jms/RemoteConnectionFactory";

                private static final String DEFAULT_DESTINATION = "jms/queue/test";

                private static final String DEFAULT_MESSAGE_COUNT = "1";

                private static final String DEFAULT_USERNAME = "quickstartUser";

                private static final String DEFAULT_PASSWORD = "quickstartPassword";

                private static final String INITIAL_CONTEXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";

                private static final String PROVIDER_URL = "remote://10.20.14.15:4447";

             

            Exception when new InitialContext is called.

             

            Exception in thread "main" javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]

                at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

                at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

                at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

                at javax.naming.InitialContext.init(Unknown Source)

                at javax.naming.InitialContext.<init>(Unknown Source)

                at org.jboss.as.quickstarts.jms.HelloWorldJMSClient.main(HelloWorldJMSClient.java:63)

            Caused by: java.lang.RuntimeException: Operation failed with status WAITING

                at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)

                at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)

                at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

                at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

                ... 5 more

             

            I run this test in the windows environment.

            • 3. Re: JMS problem in JBoss 7.1.1
              jbertram

              Don't bind to 0.0.0.0 or use a 7.2 nightly.  See https://issues.jboss.org/browse/HORNETQ-952.