1 Reply Latest reply on Aug 10, 2018 5:07 PM by jasonglass

    ActiveMQ to HornetQ (EAP 7 JMS client connectivity to EAP 6)

    jasonglass

      Hi All!

       

      Update:

      I've also posted a question on the activeMQ forum that has the code I'm trying to test with the below settings - in case this gets sorted out and it can help someone else:

      http://activemq.2283324.n4.nabble.com/Artemis-JBoss-EAP-7-to-HornetQ-EAP-6-elaboration-on-RedHat-example-td4742143.html

       

      I'm trying to deploy an EJB packaged in an EAR on JBoss EAP 7.  The EJB needs to publish to a JMS queue on an existing JBoss EAP 6 server

       

      I'm trying to get this example:

      Chapter 32. Backward and Forward Compatibility - Red Hat Customer Portal

       

      However I'm a little stuck as to this part for the InitialContext Properites:

      connectionFactory.jms/ConnectionFactory=tcp://legacy server address:5445? \

       

      And this part:

      queue.jms/myQueue=myQueue

       

      My code currently has:

      factory = (QueueConnectionFactory) ctx.lookup("java:/System/MyCompany/ApplicationType/Management/Application/12-12;2-0;AMP/Comp/QueueConnectionFactory");

       

      And:

      queue1 = (Queue) ctx.lookup("java:/com/mycompany/apackage/imp/anothercompany/ejb/NotificationQueue");

       

      I imagine the first question would be what port is 5445 with regards to the socket binding ports in standalone-full-ha.xml?  This server doesnt run on standard ports as theres an offset, hence the 10202's below, I believe thats the naming ports configured for the server.

       

      The second question would be on the queue env entry, would this "queue.jms/myQueue=myQueue" simply become this "queue.jms/NotificationQueue=NotificationQueue"

       

      Also, for multiple servers in a cluster, is this syntax still supported in the InitialContext Properites:

      java.naming.provider.url=remote://10.69.40.153:10202,remote://10.69.40.154:10202,remote://10.69.40.155:10202,remote://10.69.40.156:10202\n

       

      Any help would be greatly appreciated.  I had gone the route of trying to bundle the JBoss EAP 6 related libraries with the application and specifying the following in the jboss-deployment-structure:

      Update - xml code tag isnt working all that great so re-adding:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

          <deployment>

              <exclude-subsystems>

                  <subsystem name="messaging-activemq"></subsystem>

              </exclude-subsystems>

              <exclusions>

                  <module name="javax.jms.api"></module>

                  <module name="org.jboss.ejb"></module>

                  <module name="org.jboss.as.remoting"></module>

              </exclusions>

          </deployment>

      </jboss-deployment-structure>

       

      Which works on initial deployment however when I restart the server I get the following exception when trying to send a JMS message so it appears that the jboss-deployment-structure isn't always being honored.  I also end up getting that exception at random intervals (a day, days or weeks later) and when it occurs all future JMS messages fail to be sent almost as if JBoss forgets the application is supposed to be using its own libraries.

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.jboss.ejb.client.EJBClientContext.registerConnection(Lorg/jboss/remoting3/Connection;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/jboss/naming/remote/client/ejb/RemoteNamingStoreEJBClientHandler, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/jboss/ejb/client/EJBClientContext, have different Class objects for the type org/jboss/remoting3/Connection used in the signature