3 Replies Latest reply on Aug 12, 2010 3:26 AM by Joydeep Sarkar

    Problem creating netty connection

    Joydeep Sarkar Newbie

      Hi,

       

      While I am trying to start the live-backup pair, I get the follwing error on Live server,

      2010-08-11 17:39:01,991 ERROR [org.hornetq.integration.transports.netty.NettyConnector] (main) Failed to create netty connection
      java.net.UnknownHostException: 10.1.0.236}
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
              at java.net.Socket.connect(Socket.java:520)
              at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:114)
              at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:74)
              at org.jboss.netty.channel.Channels.connect(Channels.java:784)
              at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:188)
              at org.jboss.netty.bootstrap.ClientBootstrap$Connector.channelOpen(ClientBootstrap.java:285)
              at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:190)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannel.<init>(OioClientSocketChannel.java:48)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory.newChannel(OioClientSocketChannelFactory.java:99)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory.newChannel(OioClientSocketChannelFactory.java:79)
              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:228)
              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:192)
              at org.hornetq.integration.transports.netty.NettyConnector.createConnection(NettyConnector.java:376)
              at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:921)
              at org.hornetq.core.replication.impl.ReplicationManagerImpl.start(ReplicationManagerImpl.java:307)
              at org.hornetq.core.server.impl.HornetQServerImpl.startReplication(HornetQServerImpl.java:925)
              at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1019)
              at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:301)
              at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:179)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
      


      And I get the following error on Backup server,

      2010-08-11 17:39:01,991 ERROR [org.hornetq.integration.transports.netty.NettyConnector] (main) Failed to create netty connection
      java.net.UnknownHostException: 10.1.0.236}
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
              at java.net.Socket.connect(Socket.java:520)
              at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:114)
              at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:74)
              at org.jboss.netty.channel.Channels.connect(Channels.java:784)
              at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:188)
              at org.jboss.netty.bootstrap.ClientBootstrap$Connector.channelOpen(ClientBootstrap.java:285)
              at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:190)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannel.<init>(OioClientSocketChannel.java:48)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory.newChannel(OioClientSocketChannelFactory.java:99)
              at org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory.newChannel(OioClientSocketChannelFactory.java:79)
              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:228)
              at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:192)
              at org.hornetq.integration.transports.netty.NettyConnector.createConnection(NettyConnector.java:376)
              at org.hornetq.core.client.impl.FailoverManagerImpl.getConnection(FailoverManagerImpl.java:921)
              at org.hornetq.core.replication.impl.ReplicationManagerImpl.start(ReplicationManagerImpl.java:307)
              at org.hornetq.core.server.impl.HornetQServerImpl.startReplication(HornetQServerImpl.java:925)
              at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1019)
              at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:301)
              at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:179)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
      

       

      What I understand is that I need to configure Netty connection factory. But i am not sure how...

      I have configured the Acceptors and Connectors.

      Could anyone please tell me where exactly i have to configure the connection factory?

       

      TIA,

      Joydeep

        • 2. Re: Problem creating netty connection
          Joydeep Sarkar Newbie

          Hi Clebert,

           

          I already have the acceptors and connector defined as I mentioned earlier.

          Following is the configuration that I have,

           

          Live Server:

          <connectors>
                <connector name="netty">
                   <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                   <param key="host"  value="${hornetq.remoting.netty.host:10.1.0.71}"/>
                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                </connector>
          
                <connector name="in-vm">
                   <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                </connector>
          
                <connector name="backup-connector">
                  <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                  <param key="host" value="10.1.0.236"/>
                  <param key="port" value="5445"/>
                </connector>
          
             </connectors>
              <acceptors>
                <acceptor name="netty">
                   <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                   <param key="host"  value="${hornetq.remoting.netty.host:10.1.0.71}"/>
                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                </acceptor>
                <acceptor name="in-vm">
                  <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                  <param key="server-id" value="0"/>
                </acceptor>
             </acceptors>
          

           

          Backup server:

          <connectors>
                <connector name="netty">
                   <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                   <param key="host"  value="${hornetq.remoting.netty.host:10.1.0.236}"/>
                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                </connector>
                <connector name="in-vm">
                   <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
                </connector>
             </connectors>
             <acceptors>
                <acceptor name="netty">
                   <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                   <param key="host"  value="${hornetq.remoting.netty.host:10.1.0.71}"/>
                   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                </acceptor>
                <acceptor name="in-vm">
                  <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
                  <param key="server-id" value="0"/>
                </acceptor>
             </acceptors>
          

           

          The only difference I see is the port number which is 5445 instead of 5446.

          Do I need to specify the connection details somewhere else as well? I hope the configuration above is correct.

           

          Regaards,

          Joydeep

          • 3. Re: Problem creating netty connection
            Joydeep Sarkar Newbie

            Hi,

             

            You were correct about the connector Clebert. I figured out that the connector in the backup configuration was not correct.

            But after changing the connector I get different exception in the Live server's log as follows,

            2010-08-12 07:24:46,440 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=JMSServerManager state=Create
            HornetQException[errorCode=104 message=Connected server is not a backup server]
                    at org.hornetq.core.remoting.impl.ChannelImpl.sendBlocking(ChannelImpl.java:280)
                    at org.hornetq.core.replication.impl.ReplicationManagerImpl.start(ReplicationManagerImpl.java:326)
                    at org.hornetq.core.server.impl.HornetQServerImpl.startReplication(HornetQServerImpl.java:925)
                    at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1019)
                    at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:301)
                    at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:179)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
                    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
            


            In the backup server I see the following message,

            2010-08-12 06:50:35,780 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (main) backup server is starting..
            2010-08-12 06:50:35,905 WARN  [org.hornetq.core.persistence.impl.journal.JournalStorageManager] (main) AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
            2010-08-12 06:50:35,905 INFO  [org.hornetq.core.persistence.impl.journal.JournalStorageManager] (main) Using NIO Journal
            2010-08-12 06:50:36,686 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (main) Backup server initialised
            


            I was looking at an older thread(http://community.jboss.org/message/533448) relating to the same problem, where Tim Fox mentioned that some client is trying to connect to the backup server. I am not quite sure if any other client is trying to access the backup server.

            I hope it is fine to continue the discussion in this thread.

             

            Any thought about the same?

             

            Regards,

            Joydeep