3 Replies Latest reply on May 22, 2012 9:13 AM by yves.p

    Reconnect issues to Queue over JNDI

    yves.p

      Hi

       

      I'm using JNDI to connect to a remote JMS HornetQ ConnectionFactory an Queue running on JBoss 7. After a restart of the remote JBoss the client can't reconnect and can't lookup the queues.

      The Client is JBoss 5.1 and the Server is JBoss 7.1.1, the connection uses SSL.

      Settings on the Client:

      Messaging Service:

      Default JMS Provider: [x]
      JMS Provider Type: Other JMS
      Connection Factory Name: jms/RemoteConnectionFactory 
      Delivery Mode: Persistent
      User: Z100062
      Password: ****
      
      java.naming.factory.url.pkgs: org.jboss.ejb.client.naming
      java.naming.provider.url: remote://jspmessaging01w.uyellow.yellowcorp.test:4447
      java.naming.security.principal: Z100062
      java.naming.security.credentials: *****
      java.naming.factory.initial: org.jboss.naming.remote.client.InitialContextFactory
      jboss.naming.client.connect.options.org.xnio.Options.SSL_STARTTLS: true
      jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED: true
      

       

       

      Log:

      2012-04-12 21:47:47,693 WARNING [AeException] (AeWorkManager-WorkerThread-1) The product license does not include Socrates.

      To obtain a license please contact your Active Endpoints, Inc. representative

      or

      visit www.activevos.com

      2012-04-12 21:47:49,189 INFO  [org.xnio] (AeWorkManager-WorkerThread-1) XNIO Version 3.0.3.GA

      2012-04-12 21:47:49,204 INFO  [org.xnio.nio] (AeWorkManager-WorkerThread-1) XNIO NIO Implementation Version 3.0.3.GA

      2012-04-12 21:47:49,233 INFO  [org.jboss.remoting] (AeWorkManager-WorkerThread-1) JBoss Remoting version 3.2.2.GA

      2012-04-12 21:47:50,278 INFO  [ActiveVOS] (AeWorkManager-WorkerThread-1) AeClusterLicenseManager is starting

       

      ----- Reboot of the Remote Server -----------------

      2012-04-12 22:33:36,043 ERROR [org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1] (Remoting "config-based-naming-client-endpoint" task-1) Channel end notification received, closing channel Channel ID c e2c358 (outbound) of Remoting connection 00d37a2b to null

      2012-04-12 22:33:36,168 WARNING [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (Thread-1 (HornetQ-client-global-threads-14272790)) Connection failure has been detected: The connection was disco nected because of server shutdown [code=4]

       

      ----- After Remote Server has started try to use a Queue -----------------

      2012-04-12 22:34:46,534 SEVERE [AeException] (AeWorkManager-WorkerThread-8) JMS Destination not found with JNDI name queue/rdp.mps.contract.flow.update.queue

      com.activee.rt.mom.AeMessagingException: JMS Destination not found with JNDI name queue/rdp.mps.contract.flow.update.queue

              at com.activee.rt.mom.jms.AeJndiJmsManager.lookupDestination(AeJndiJmsManager.java:135)

              at com.activee.rt.mom.jms.AeJndiJmsManager.getDestination(AeJndiJmsManager.java:97)

              at com.activee.rt.mom.jms.AeAbstractJmsManager.sendMessage(AeAbstractJmsManager.java:288)

              at com.activee.rt.mom.jms.transport.AeJmsOnewaySender.sendMessage(AeJmsOnewaySender.java:67)

              at com.activee.rt.mom.jms.transport.AeJmsXmlInvokeHandler.handleInvoke(AeJmsXmlInvokeHandler.java:62)

              at org.activebpel.rt.bpel.server.engine.invoke.AeInvoker.handleInvoke(AeInvoker.java:207)

              at org.activebpel.rt.bpel.server.engine.AeInMemoryQueueManager$1.run(AeInMemoryQueueManager.java:149)

              at org.activebpel.work.AeDelegatingWork.run(AeDelegatingWork.java:62)

              at org.activebpel.work.AeProcessWorkManager$AeProcessWork.run(AeProcessWorkManager.java:254)

              at org.activebpel.work.AeDelegatingWork.run(AeDelegatingWork.java:62)

              at org.activebpel.work.AeExceptionReportingWork.run(AeExceptionReportingWork.java:58)

              at org.activebpel.work.AeWorkerThread.run(AeWorkerThread.java:156)

      Caused by: javax.naming.NamingException: Failed to lookup [Root exception is org.jboss.remoting3.NotOpenException: Writes closed]

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

              at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:104)

              at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:79)

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)

              at javax.naming.InitialContext.lookup(InitialContext.java:392)

              at com.activee.rt.mom.jms.AeJndiJmsManager.lookupDestination(AeJndiJmsManager.java:113)

              ... 11 more

      Caused by: org.jboss.remoting3.NotOpenException: Writes closed

              at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:107)

              at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:296)

              at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:59)

              at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:76)

              ... 16 more

       

      com.activee.rt.mom.AeMessagingException: JMS Destination not found with JNDI name queue/rdp.mps.contract.flow.update.queue

              at com.activee.rt.mom.jms.AeJndiJmsManager.lookupDestination(AeJndiJmsManager.java:135)

              at com.activee.rt.mom.jms.AeJndiJmsManager.getDestination(AeJndiJmsManager.java:97)

              at com.activee.rt.mom.jms.AeAbstractJmsManager.sendMessage(AeAbstractJmsManager.java:288)

              at com.activee.rt.mom.jms.transport.AeJmsOnewaySender.sendMessage(AeJmsOnewaySender.java:67)

              at com.activee.rt.mom.jms.transport.AeJmsXmlInvokeHandler.handleInvoke(AeJmsXmlInvokeHandler.java:62)

              at org.activebpel.rt.bpel.server.engine.invoke.AeInvoker.handleInvoke(AeInvoker.java:207)

              at org.activebpel.rt.bpel.server.engine.AeInMemoryQueueManager$1.run(AeInMemoryQueueManager.java:149)

              at org.activebpel.work.AeDelegatingWork.run(AeDelegatingWork.java:62)

              at org.activebpel.work.AeProcessWorkManager$AeProcessWork.run(AeProcessWorkManager.java:254)

              at org.activebpel.work.AeDelegatingWork.run(AeDelegatingWork.java:62)

              at org.activebpel.work.AeExceptionReportingWork.run(AeExceptionReportingWork.java:58)

              at org.activebpel.work.AeWorkerThread.run(AeWorkerThread.java:156)

      Caused by: javax.naming.NamingException: Failed to lookup [Root exception is org.jboss.remoting3.NotOpenException: Writes closed]

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

              at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:104)

              at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:79)

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)

              at javax.naming.InitialContext.lookup(InitialContext.java:392)

              at com.activee.rt.mom.jms.AeJndiJmsManager.lookupDestination(AeJndiJmsManager.java:113)

              ... 11 more

      Caused by: org.jboss.remoting3.NotOpenException: Writes closed

              at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:107)

              at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:296)

              at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:59)

              at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:76)

              ... 16 more

       

      Do I have to set additional context properties for it to work? Can I connect to more than one server over jndi for high availability?

        • 1. Re: Reconnect issues to Queue over JNDI
          jaikiran

          Looks like remote-naming doesn't support auto reconnect. Please file a JIRA as a feature request here https://issues.jboss.org/browse/AS7

          • 2. Re: Reconnect issues to Queue over JNDI
            michel.strogoff

            Hi Peter,

             

            I am trying to achieve the same (without SSL) and I would like to ask you 2 questions about this :

             

            1) How did you configure class loading in JBoss AS 5.1 to ensure that the client would use the AS 7 jboss-client.jar to perform the lookup (instead of AS 5.1 client jars) ?

             

            2) If auto-reconnect is not supported, does it mean that you have to restart the client server in order to be able to reconnect ? Is there a workaround ?

             

            Thanks for your help,

            Best regards,

            Eric

            • 3. Re: Reconnect issues to Queue over JNDI
              yves.p

              Hi Eric

               

              It's a bit ugly:

              1) I put the libraries that are listed in jboss-as-7.1.1.Final\bin\client\README.txt into the EAR an changed the classloader to parent last (it was already that way):

               

              ave_jboss.ear\META-INF\jboss-classloading.xml

               

              <?xml version="1.0" encoding="UTF-8"?>
              <classloading xmlns="urn:jboss:classloading:1.0"
                            name="ave_jboss.ear"
                            domain="ave_jboss.ear"
                            parentDomain="DefaultDomain"
                            top-level-classloader="true"
                            parent-first="false"
                            export-all="NON_EMPTY"
                            import-all="true">
              </classloading>
              

               

              ave_jboss.ear\META-INF\jboss-app.xml

              <jboss-app>
                 <module-order>strict</module-order> 
                 <loader-repository>
                      com.activee:loader=activee.ear
                      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                 </loader-repository>
              </jboss-app>
              

               

              I'm not sure that's all you have to configure because it was already like that.

              I downloaded the libs from the maven repo but didn't add the org.jboss.spec.javax.* libs because they caused problems for the application (it's an EJB 2 App but the libs contain the EJB 3 API). I don't think it's a good idea to include the JEE API libs in the jboss-client.jar anyway...

               

              2) In the issue attached to this thread is a description of a workaround. Like described I tried to add a second URL in the java.naming.provider.url but it didn't work for me (like this: remote://jspmessaging01w.uyellow.yellowcorp.test:4447,remote://jspmessaging01w.uyellow.yellowcorp.test:4447).

               

              Hope it helps.

              Yves