2 Replies Latest reply on Mar 19, 2010 11:37 AM by adrian.brock

    JCA / JNDI / ActiveMQ

      Hi,

      i have successfully embedded ActiveMQ via JCA/RA in JBoss 5.1:
      http://activemq.apache.org/integrating-apache-activemq-with-jboss.html

      Now I like to use JNDI to lookup ActiveMQs ConnectionFactory and the Destinations from a java/jms client outside the application server.

      My Problem is, that i get a null pointer object back form jndi lookup, and this is obviously not new:
      http://www.nabble.com/JBoss-and-ActiveMQ-with-remote-JNDI-to16961289.html#a16961289

      In this thread some JBoss guy writes about this architecture problem:
      JBoss answer
      "/The connection factories provided by a Resource Adapter (RA) are
      typically not available for use by clients that are outside of the
      application server. That is, the JCA specification is intended to
      provided resources to the application server, and relies upon behavior
      on the part of the application server in connection pool management,
      transaction management, and security.

      Also, for this reason, the JNDI location of the RA's ConnectionFactories
      should be located in the "java:" namespace. This namespace is local to
      the jvm and has no visibility to external clients./"

      So my question is, may I use MQ Providers from Clients outside the application server or may i only use it via EJB components like MDBs ?

      I am confused - because JBoss Messaging is (as far as i know) also embedded via JCA and also bound to global JNDI and - I can successfully lookup the JBoss Messaging ConnectionFactory from a client outside !!! Why does it work - is this bug a feature ? ;-)

      Thx so far !

        • 1. Re: JCA / JNDI / ActiveMQ

          Hello Alexander,

           

          Have you got your answer for this question?

           

          Have you try to use ActiveMQ resource adaptor to connect to ActiveMQ running separately from JBoss 5.1? I am keep getting the following runtime exception when start up JBoss 5.1 instance, the same configruation works just fine in JBoss 4.2.2GA:

          Caused by: java.lang.RuntimeException: Unable to choose messagingType interface for MDB AuditService from []
          at org.jboss.ejb3.mdb.MDB.getMessagingType(MDB.java:76)
          at org.jboss.ejb3.mdb.MDB.resolveBusinessInterfaces(MDB.java:132)
          at org.jboss.ejb3.EJBContainer.instantiated(EJBContainer.java:1564)
          at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:726)

           

          Also, were you able to use JNDI name for inbound queue with ActiveMQ? I have to specify the physical Queue name inside my MDB for inbound message, but prefer to use jndi name in my code and configure the jndi name in adminobject inside activemq-jms-ds.xml file. How did you get around tis?

           

          thanks

           

          Kelly

          • 2. Re: JCA / JNDI / ActiveMQ

            Alexander Petitjean wrote:


            I am confused - because JBoss Messaging is (as far as i know) also embedded via JCA and also bound to global JNDI and - I can successfully lookup the JBoss Messaging ConnectionFactory from a client outside !!! Why does it work - is this bug a feature ? ;-)

            Thx so far !

            This is an FAQ.

             

            The JCA ConnectionFactorys are pools for local use bound in the java:/ namespace which is not accesible remotely.

             

            JBoss Messaging provides a different ConnectionFactory for remote client usage.

             

            For what ActiveMQ provides, you'll need to ask them.

            Whatever it is, it needs to be bound in the global namespace, not java:/