8 Replies Latest reply on Mar 30, 2009 5:09 AM by gaohoward

    JBM 2.0 BETA1 -- quque/topicExample failed in jndi lookup

    gaohoward

      build from trunk, then start JBM server and run ant queueExample, it fails with 'connection refused' exception. From the log I can see the lookup always try to contact 127.0.1.1 rather than the usual 127.0.0.1. Here is the log:

      queueExample:
       [java] Mar 30, 2009 11:19:20 AM org.jboss.messaging.core.logging.Logger info
       [java] INFO: initial context end: {jnp.parsedName=, java.naming.provider.url=127.0.0.1:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}
       [java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
       [java] java.net.ConnectException: Connection refused]
       [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:782)
       [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
       [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
       [java] at org.jboss.jms.example.QueueExample.main(QueueExample.java:64)
       [java] Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
       [java] java.net.ConnectException: Connection refused
       [java] at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
       [java] at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
       [java] at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
       [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
       [java] at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:179)
       [java] at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
       [java] at $Proxy0.lookup(Unknown Source)
       [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
       [java] ... 3 more
       [java] Caused by: java.net.ConnectException: Connection refused
       [java] at java.net.PlainSocketImpl.socketConnect(Native Method)
       [java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
       [java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
       [java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
       [java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
       [java] at java.net.Socket.connect(Socket.java:520)
       [java] at java.net.Socket.connect(Socket.java:470)
       [java] at java.net.Socket.<init>(Socket.java:367)
       [java] at java.net.Socket.<init>(Socket.java:180)
       [java] at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
       [java] at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
       [java] at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
       [java] ... 10 more
      



        • 1. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
          timfox

          Probably you have localhost resolving to 127.0.1.1 in your hosts file

          • 2. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
            gaohoward

            gee! exactly my hosts has that entry:

            127.0.0.1 localhost
            127.0.1.1 howard-laptop
            


            The example runs OK after removing it!

            Thanks Tim!


            • 3. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
              gaohoward

              another problem found with topicExample when this issue removed, client side:

              $ ant topicExample
              Buildfile: build.xml
              
              init:
              
              compile:
              
              topicExample:
               [java] javax.jms.JMSException
               [java] at org.jboss.messaging.core.remoting.impl.wireformat.MessagingExceptionMessage.decodeBody(MessagingExceptionMessage.java:88)
               [java] at org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.decode(PacketImpl.java:209)
               [java] at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.decode(RemotingConnectionImpl.java:884)
               [java] at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:512)
               [java] at org.jboss.messaging.core.client.impl.ConnectionManagerImpl$DelegatingBufferHandler.bufferReceived(ConnectionManagerImpl.java:1066)
               [java] at org.jboss.messaging.integration.transports.netty.MessagingChannelHandler.messageReceived(MessagingChannelHandler.java:75)
               [java] at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
               [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
               [java] at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:802)
               [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:385)
               [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.fireMessageReceived(FrameDecoder.java:310)
               [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:287)
               [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:210)
               [java] at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
               [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.handleUpstream(FrameDecoder.java:170)
               [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
               [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:562)
               [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:342)
               [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:329)
               [java] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:296)
               [java] at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:251)
               [java] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:173)
               [java] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72)
               [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
               [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
               [java] at java.lang.Thread.run(Thread.java:595)
               [java] Caused by: MessagingException[errorCode=0 message=null]
               [java] ... 26 more
              
              BUILD SUCCESSFUL
              Total time: 1 second
              
              


              Server Side

              16:52:42,380 ERROR @New I/O server worker #1-2 [ServerSessionImpl] Failed to create queue
              java.lang.NullPointerException
               at org.jboss.messaging.utils.SimpleString.<init>(SimpleString.java:84)
               at org.jboss.messaging.core.security.impl.SecurityStoreImpl.check(SecurityStoreImpl.java:175)
               at org.jboss.messaging.core.server.impl.ServerSessionImpl.doHandleCreateQueue(ServerSessionImpl.java:1293)
               at org.jboss.messaging.core.server.impl.ServerSessionImpl.handleCreateQueue(ServerSessionImpl.java:380)
               at org.jboss.messaging.core.server.impl.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:126)
               at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl$ChannelImpl.handlePacket(RemotingConnectionImpl.java:1535)
               at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl$ChannelImpl.access$600(RemotingConnectionImpl.java:893)
               at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:522)
               at org.jboss.messaging.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:360)
               at org.jboss.messaging.integration.transports.netty.MessagingChannelHandler.messageReceived(MessagingChannelHandler.java:75)
               at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
               at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
               at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:802)
               at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:385)
               at org.jboss.netty.handler.codec.frame.FrameDecoder.fireMessageReceived(FrameDecoder.java:310)
               at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:287)
               at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:210)
               at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
               at org.jboss.netty.handler.codec.frame.FrameDecoder.handleUpstream(FrameDecoder.java:170)
               at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
               at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:562)
               at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:342)
               at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:329)
               at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:296)
               at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:251)
               at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:173)
               at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
               at java.lang.Thread.run(Thread.java:595)
              
              


              • 4. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
                ataylor

                Howard, I wouldn't spend too much time trying to get the examples to work. We're in the process of re-writing them.

                • 5. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
                  jmesnil

                   

                  "gaohoward" wrote:
                  another problem found with topicExample when this issue removed, client side:


                  I've fixed the issue.


                  • 6. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
                    jmesnil

                    oops... I submitted too fast...

                    I've fixed the issue in r6210. SimpleString ctor does not accept null strings.

                    • 7. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
                      gaohoward

                      Thanks Jeff! you are fast. :)

                      • 8. Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
                        gaohoward

                        Thanks Andy. You are fast too. :)