1 Reply Latest reply on Apr 21, 2012 9:02 AM by jboss_sa

    JBoss 7.1.2 AS/HornetQ - MDB Connectivity Issue

    jboss_sa Newbie

      Hi,

      I'm facing a connectivity issue when I deploy the MDBs, if I deplyed 5 instances of MDBs the connection is established successfully and MDBs are connected to the queues, if I deployed more than that a connection problem occurs which is "Failed to create netty connection", I'll explain much further:

       

      I've configured two JBoss 7.1.2 NB instances as follow:

           1. Standalone JBoss Server AS - "Windows: Server1".

           2. Standalone JBoss Server HornetQ - "UNIX: Server2".

           3. MDB's deployed into Server1 AS.

      note that these two servers are in different environments and I've configured the two servers successfully, the AS is connected to the remote HornetQ using remote connector as follows:

          

      <connector name="remote-connector">

             <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

             <param key="host" value="${jboss.bind.address:x.x.x.x}"/>

             <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

      </connector>

       

      <acceptor name="remote-connector">

             <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

      </acceptor>

       

      <pooled-connection-factory name="hornetq-ra">

              <user>user1</user>

              <password>user12</password>

              <min-pool-size>50</min-pool-size>

              <max-pool-size>100</max-pool-size>

              <transaction mode="xa"/>

                  <connectors>

                             <connector-ref connector-name="remote-connector"/>

                  </connectors>

                  <entries>

                             <entry name="java:/JmsXA"/>

                  </entries>

      </pooled-connection-factory>

       

      Sample of ejb-jar.xml file:

      <message-driven>

                                    <ejb-name>MDB_M_0</ejb-name>

                                    <ejb-class>com.elm.tesmdb.TestMDB</ejb-class>

                                    <transaction-type>Bean</transaction-type>

                                    <message-destination-type>javax.jms.Queue</message-destination-type>

                                    <activation-config>

                                              <activation-config-property>

                                                        <activation-config-property-name>acknowledgeMode</activation-config-property-name>

                                                        <activation-config-property-value>AUTO_ACKNOWLEDGE</activation-config-property-value>

                                              </activation-config-property>

                                              <activation-config-property>

                                                        <activation-config-property-name>destinationType</activation-config-property-name>

                                                        <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                                              </activation-config-property>

                                              <activation-config-property>

                                                        <activation-config-property-name>destination</activation-config-property-name>

                                                        <activation-config-property-value>java:/queue/I_M.R_I0</activation-config-property-value>

                                              </activation-config-property>

                                              <activation-config-property>

                                                        <activation-config-property-name>user</activation-config-property-name>

                                                        <activation-config-property-value>user1</activation-config-property-value>

                                              </activation-config-property>

                                              <activation-config-property>

                                                        <activation-config-property-name>password</activation-config-property-name>

                                                        <activation-config-property-value>user12</activation-config-property-value>

                                              </activation-config-property>

                                    </activation-config>

                          </message-driven>

       

       

      Sample Of server log:

      15:36:18,956 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "RemoteMDB.jar"

      15:36:19,255 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named ResponseHandlerBean in deployment unit deployment "RemoteMDB.jar" are as follows:

       

       

                java:global/RemoteMDB/ResponseHandlerBean!com.elm.tesmdb.ResponseHandlerBeanLocal

                java:app/RemoteMDB/ResponseHandlerBean!com.elm.tesmdb.ResponseHandlerBeanLocal

                java:module/ResponseHandlerBean!com.elm.tesmdb.ResponseHandlerBeanLocal

                java:global/RemoteMDB/ResponseHandlerBean

                java:app/RemoteMDB/ResponseHandlerBean

                java:module/ResponseHandlerBean

       

       

      15:36:19,375 INFO  [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011941: Register module: Module "deployment.RemoteMDB.jar:main" from Service Module Loader

      15:36:19,423 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) JBAS014142: Started message driven bean 'MDB_M_1' with 'hornetq-ra' resource adapter

      15:36:19,444 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) JBAS014142: Started message driven bean 'MDB_M_2' with 'hornetq-ra' resource adapter

      15:36:19,424 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) JBAS014142: Started message driven bean 'MDB_M_3' with 'hornetq-ra' resource adapter

      15:36:19,424 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) JBAS014142: Started message driven bean 'MDB_M_0' with 'hornetq-ra' resource adapter

      15:36:19,423 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) JBAS014142: Started message driven bean 'MDB_I_3' with 'hornetq-ra' resource adapter

      15:36:19,458 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) JBAS014142: Started message driven bean 'MDB_I_1' with 'hornetq-ra' resource adapter

      15:36:19,454 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) JBAS014142: Started message driven bean 'MDB_I_2' with 'hornetq-ra' resource adapter

      15:36:19,445 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) JBAS014142: Started message driven bean 'MDB_I_0' with 'hornetq-ra' resource adapter

      15:36:19,794 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "RemoteMDB.jar"

      15:36:29,514 ERROR [org.hornetq.core.remoting.impl.netty.NettyConnector] (default-threads - 5) Failed to create netty connection: java.net.SocketTimeoutException: connect timed out

                at java.net.PlainSocketImpl.socketConnect(Native Method) [rt.jar:1.6.0_25]

                at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) [rt.jar:1.6.0_25]

                at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) [rt.jar:1.6.0_25]

                at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) [rt.jar:1.6.0_25]

                at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) [rt.jar:1.6.0_25]

                at java.net.Socket.connect(Socket.java:529) [rt.jar:1.6.0_25]

                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:114) [netty-3.2.6.Final.jar:]

                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:74) [netty-3.2.6.Final.jar:]

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

                at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:210) [netty-3.2.6.Final.jar:]

                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227) [netty-3.2.6.Final.jar:]

                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188) [netty-3.2.6.Final.jar:]

                at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:473) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnection(ClientSessionFactoryImpl.java:1143) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnectionWithRetry(ClientSessionFactoryImpl.java:993) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connect(ClientSessionFactoryImpl.java:224) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:747) [hornetq-core-2.2.13.Final.jar:]

                at org.hornetq.ra.inflow.HornetQActivation.setupSession(HornetQActivation.java:362) [hornetq-ra-2.2.13.Final.jar:]

                at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:294) [hornetq-ra-2.2.13.Final.jar:]

                at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:605) [hornetq-ra-2.2.13.Final.jar:]

                at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:212)

                at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)

                at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:801)

                at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)

                at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:821)

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

                at org.jboss.threads.JBossThread.run(JBossThread.java:122)

       

      please any advice that can help me to solve this issue?

        • 1. Re: JBoss 7.1.2 AS/HornetQ - MDB Connectivity Issue
          jboss_sa Newbie

          Solved by adding Client ID to activation-config:

               <activation-config-property>

                                                                      <activation-config-property-name>clientID</activation-config-property-name>

                                                                      <activation-config-property-value>myID</activation-config-property-value>

               </activation-config-property>