6 Replies Latest reply on Jun 19, 2013 2:20 PM by Justin Bertram

    JBoss 7 MDB connecting in JBoss 4.2 Topic

    Gabriel Ozeas Newbie

      Hi folks,

       

      Can someone help me? I searched in all google corners to find a solution for connect a MDB deployed in JBoss 7 to a Topic in a remote JBoss 4.2, but i couldnt find one.

      I'm not a specialist in JBoss, but i read about resource adapters.

       

      I found this: https://docs.jboss.org/author/display/AS7/Resource+adapters

      But not very helpful.

       

      JBoss 7 uses HornetQ while 4.2 uses JBossMQ. Is this a problem?

       

      Do someone know about any documentation that can help me, or some approach to get there?

       

      Thanks very much,

      Gabriel

        • 1. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
          Justin Bertram Master

          Check out https://github.com/jbertram/generic-jms-ra.  It has documentation for integrating with JBoss AS 5.x, but it shouldn't be hard to do the same for JBoss AS 4.x.  You'll mainly just need different libraries.

          1 of 1 people found this helpful
          • 2. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
            Gabriel Ozeas Newbie

            I found this tutorial about JBoss7 and TibcoEMS? I could apply for jms-rar from JBossMQ?

            https://community.jboss.org/wiki/JBoss7IntegrationWithTibcoEMSUsingGenericJMSRA

            • 3. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
              Justin Bertram Master

              You could go that route, but you'll have to modify and re-build the old Sun generic JMS JCA RA.  See my previous comment for what I think is a better approach.

              1 of 1 people found this helpful
              • 4. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
                Gabriel Ozeas Newbie

                Thanks Justin,

                 

                I think its a lot of work. I will try the first approach.

                 

                Thank you again,

                Gabriel

                • 5. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
                  Gabriel Ozeas Newbie

                  Hi Justin,

                   

                  After 3 days, i'm following the GitHub Instructions but now i'm using genericjmsra

                  I download de svn project, edit the XML, added the interfaces..

                   

                  I packaged and put it in deployments dir

                  I started the JBoss and it deployed genericra.rar with success.

                   

                  I added this config to standalone-full.xml:

                   

                  {code:xml}

                  <resource-adapters>

                                  <resource-adapter>

                                      <archive>

                                          genericra.rar

                                      </archive>

                                      <transaction-support>XATransaction</transaction-support>

                                      <config-property name="LogLevel">

                                          finest

                                      </config-property>

                                      <config-property name="ProviderIntegrationMode">

                                          jndi

                                      </config-property>

                                      <config-property name="JndiProperties">

                                          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces,java.naming.provider.url=jnp://broker-address:port

                                      </config-property>

                                  </resource-adapter>

                              </resource-adapters>

                  {code}

                   

                  I also changed here

                   

                  {code}

                  <mdb>

                         <resource-adapter-ref resource-adapter-name="genericra.rar"/>

                         <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                  </mdb>

                  {code}

                   

                   

                  And i added the jboss 4.2.3 jbossall-client.jar to jboss 7 modules:

                   

                  {code:xml}

                  <module xmlns="urn:jboss:module:1.1" name="org.jboss.jboss-5-client">

                      <resources>

                          <resource-root path="jbossall-client.jar"/>

                      </resources>

                   

                      <dependencies>

                          <module name="javax.api"/>

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

                      </dependencies>

                  </module>

                  {code}

                   

                  And added a MANIFEST.MF to genericra.rar with dependencies line:

                  {code}Dependencies: org.jboss.jboss-5-client{code}

                   

                  I created a simple project with a MDB using @ResourceAdapter annotation.

                  And when i deploy the application, apparently the Resource Adapter cannot find jbossall-client (InitialContext implementation).

                   

                  Here is the stacktrace:

                   

                  {code}

                  MSC00001: Failed to start service jboss.deployment.subunit."simple-ear.ear"."simple-ejb.jar".component.SimpleMDB.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."simple-ear.ear"."simple-ejb.jar".component.SimpleMDB.START: Failed to start service

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_34]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_34]

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

                  Caused by: java.lang.RuntimeException: javax.resource.spi.InvalidPropertyException: JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module "org.jboss.as.ee:main" from local module loader @4cf7c31d (roots: /opt/java/servidores/jboss/jboss7/modules)

                      at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:171)

                      at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      ... 3 more

                  Caused by: javax.resource.spi.InvalidPropertyException: JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module "org.jboss.as.ee:main" from local module loader @4cf7c31d (roots: /opt/java/servidores/jboss/jboss7/modules)

                      at com.sun.genericra.util.ExceptionUtils.newInvalidPropertyException(ExceptionUtils.java:42)

                      at com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.createObject(ObjectBuilderFactory.java:100)

                      at com.sun.genericra.util.ObjectBuilder.build(ObjectBuilder.java:100)

                      at com.sun.genericra.inbound.AbstractConsumer.initializeAdministeredObjects(AbstractConsumer.java:95)

                      at com.sun.genericra.inbound.AbstractConsumer.<init>(AbstractConsumer.java:63)

                      at com.sun.genericra.inbound.async.EndpointConsumer.<init>(EndpointConsumer.java:57)

                      at com.sun.genericra.inbound.EndpointConsumerFactory.createEndpointConsumer(EndpointConsumerFactory.java:45)

                      at com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.java:215)

                      at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:164)

                      at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:169)

                      ... 6 more

                  Caused by: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jnp.interfaces.NamingContextFactory from classloader ModuleClassLoader for Module "org.jboss.as.ee:main" from local module loader @4cf7c31d (roots: /opt/java/servidores/jboss/jboss7/modules)

                      at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)

                      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664) [rt.jar:1.6.0_34]

                      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) [rt.jar:1.6.0_34]

                      at javax.naming.InitialContext.init(InitialContext.java:223) [rt.jar:1.6.0_34]

                      at javax.naming.InitialContext.<init>(InitialContext.java:197) [rt.jar:1.6.0_34]

                      at com.sun.genericra.util.ObjectBuilderFactory$JndiObjectBuilder.createObject(ObjectBuilderFactory.java:95)

                      ... 14 more

                  {code}

                   

                  I looked at google and found this post with the same problem. So i downloaded JBoss EAP 6, and try again, with the same error.

                   

                  Do someone knows how this can be resolved?

                   

                  Thanks

                  • 6. Re: JBoss 7 MDB connecting in JBoss 4.2 Topic
                    Justin Bertram Master

                    It looks like your using Sun's old generic JMS JCA RA rather than the one I recommended so I can't help you with any specifics on it. 

                     

                    That said, your problem appears to be classloading related.  I don't know the answer off the top of my head, and I don't have time to dig further.