2 Replies Latest reply on Dec 5, 2013 10:22 AM by Justin Bertram

    Bridge between JBoss 4.2.1 JBM to HornetQ in EAP 6.1.0 GA

    Michael Gentzsch Newbie

      Hi,

       

      we implemented a jms-bridge in JBoss 4.2.1 to HornetQ in an EAP 6.1 following this instructions. https://community.jboss.org/wiki/BridgeJMSMessagesFromAS5ToAS7

       

      It runs perfectly. But there is a problem. We need to guarantee that the bridge is correct after network errors. We used wanEM to simulate network troubles. After it we have problems.

       

      The bridge tries to reconnect without success. The following stacktrace is shown. It looks like the classloader lost the context-impl from th SAR but we don't know why and why now!

       

      Stacktrace:

      1. javax.naming.NoInitialContextException: Cannot instantiate class: org.jboss.naming.remote.client.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.naming.remote.client.InitialContextFactory]

      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)

      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

      at javax.naming.InitialContext.init(InitialContext.java:223)

      at javax.naming.InitialContext.<init>(InitialContext.java:197)

      at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:63)

      at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)

      at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:921)

      at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1163)

      at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)

      at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1518)

      at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.naming.remote.client.InitialContextFactory

      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)

      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)

      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:247)

      at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)

      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)

      ... 10 more

        • 1. Re: Bridge between JBoss 4.2.1 JBM to HornetQ in EAP 6.1.0 GA
          Michael Gentzsch Newbie

          Hi,

           

          I removed the following from the jboss-service.xml in the SAR.

           

          <loader-repository-config>java2ParentDelegation=false</loader-repository-config>

           

          After it I started the test of network errors and the bridge show me this stacktrace.

           

          2013-12-05 11:52:01,587 WARN  [Bridge] Failed to send + acknowledge batch, closing JMS objects

          javax.jms.JMSException: Connection failure detected. Unblocking a blocking call that will never get a response

            at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:312)

            at org.hornetq.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:287)

            at org.hornetq.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:142)

            at org.hornetq.jms.client.HornetQMessageProducer.doSend(HornetQMessageProducer.java:451)

            at org.hornetq.jms.client.HornetQMessageProducer.send(HornetQMessageProducer.java:246)

            at org.jboss.jms.server.bridge.Bridge.sendMessages(Bridge.java:1350)

            at org.jboss.jms.server.bridge.Bridge.sendBatchNonTransacted(Bridge.java:1201)

            at org.jboss.jms.server.bridge.Bridge.sendBatch(Bridge.java:1315)

            at org.jboss.jms.server.bridge.Bridge.access$1900(Bridge.java:66)

            at org.jboss.jms.server.bridge.Bridge$SourceListener.onMessage(Bridge.java:1642)

            at org.jboss.jms.client.container.ClientConsumer.callOnMessage(ClientConsumer.java:159)

            at org.jboss.jms.client.container.ClientConsumer$ListenerRunner.run(ClientConsumer.java:976)

            at org.jboss.messaging.util.JBMExecutor$TCLExecutor.run(JBMExecutor.java:78)

            at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java:89)

            at java.lang.Thread.run(Thread.java:662)

          Caused by: HornetQException[errorCode=5 message=Connection failure detected. Unblocking a blocking call that will never get a response]

            ... 15 more

           

          And the main-Log show me this

          2013-12-05 11:52:11,649 ERROR [STDERR] Exception in thread "Thread-316"

          2013-12-05 11:52:11,649 ERROR [STDERR] Exception in thread "Thread-315"

          2013-12-05 11:52:11,649 ERROR [STDERR] java.lang.NoClassDefFoundError: org/xnio/Options

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.naming.remote.client.InitialContextFactory.<clinit>(InitialContextFactory.java:89)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Class.forName0(Native Method)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Class.forName(Class.java:247)

          2013-12-05 11:52:11,649 ERROR [STDERR] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.init(InitialContext.java:223)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.<init>(InitialContext.java:197)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:63)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:921)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1163)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1518)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)

          2013-12-05 11:52:11,649 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.xnio.Options

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

          2013-12-05 11:52:11,649 ERROR [STDERR] ... 15 more

          2013-12-05 11:52:11,649 ERROR [STDERR] java.lang.NoClassDefFoundError: Could not initialize class org.jboss.naming.remote.client.InitialContextFactory

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Class.forName0(Native Method)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Class.forName(Class.java:247)

          2013-12-05 11:52:11,649 ERROR [STDERR] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.init(InitialContext.java:223)

          2013-12-05 11:52:11,649 ERROR [STDERR] at javax.naming.InitialContext.<init>(InitialContext.java:197)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:63)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:921)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1163)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)

          2013-12-05 11:52:11,649 ERROR [STDERR] at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1518)

          2013-12-05 11:52:11,649 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)

           

          I am sure that org.xnio.Options is part of the jar.

          • 2. Re: Bridge between JBoss 4.2.1 JBM to HornetQ in EAP 6.1.0 GA
            Justin Bertram Master

            I believe the problem you're hitting is a defect either in the bridge itself or in JBoss AS itself related to the thread which handles the failure and classloading.  I believe this has been resolved upstream via https://issues.jboss.org/browse/WFLY-2499.