2 Replies Latest reply on Sep 9, 2013 8:01 AM by Vova Kurilow

    ActiveMQ with JBoss 7.1

    Vova Kurilow Newbie

      Hello together,

       

      I have a problem with activemMQ implementation on JBOSS 7. We are on he way to migrate our app from JBoss 6 to JBoss 7.

       

      I read this instruction: Integration of JBoss AS 7 with ActiveMQ

      but it doesnt work for me.

       

      I downloaded and put activemq-ra.rar into standalone/deployments/

      I updated ra.xml for "ActiveMQ as an internal messaging broker"

       

      I have following  in standalone-full.xml

        <resource-adapters>

                      <resource-adapter>

                          <archive>

                              activemq-ra.rar

                          </archive>

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

                          <config-property name="ServerUrl">

                             vm://localhost

                          </config-property>

                          <connection-definitions>

                              <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/activemq/ConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionFactoryPool" use-ccm="true">

                                  <xa-pool>

                                      <min-pool-size>1</min-pool-size>

                                      <max-pool-size>20</max-pool-size>

                                  </xa-pool>

                              </connection-definition>

                          </connection-definitions>

                          <admin-objects>

                              <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_out" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_out">

                                  <config-property name="PhysicalName">

                                      queue.queue_out

                                  </config-property>

                              </admin-object>

                              <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_in" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_in">

                                  <config-property name="PhysicalName">

                                      queue.queue_in

                                  </config-property>

                              </admin-object>

                          </admin-objects>

                      </resource-adapter>

                  </resource-adapters>

       

      in my class I try to get a connectionFactory with

      Context ctx = new initialContext();

      ctx.lookup("java:/activemq/ConnectionFactory");

       

      I start my jboss like this: standalone.bat -c standalone-full.xml

       

      during deploy process I get following exception:

      An exception was thrown while retrieving the connection factory fron the jndi context under JNDI 'java:/activemq/ConnectionFactory'

      Caused by: javax.naming.NameNotFoundException: activemq/ConnectionFactory -- service jboss.naming.context.java.activemq.ConnectionFactory

       

      in the example the access to the ConnectionFactory is implemented with @Ressource(mappedName="java:/activemq/ConnectionFactory")

      is it the possible to use the initialContext for this purpose???

      how can I do it??

       

      thank you for your answer.

        • 1. Re: ActiveMQ with JBoss 7.1
          Vova Kurilow Newbie

          I found one more configuration for standalone-full.xml on this page Embed ActiveMQ in JBoss AS 7

           

          <mdb>

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

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

                      </mdb>

          I tried with this configuration, but it still doesnt work.

           

          JBoss should log following message on startup:

          INFO [org.jboss.as.deployment.connector] (MSC service thread 1-8) JBAS010406: Registered connection factory java:jboss/exported/ConnectionFactory 

           

          in my case I await to see

          Registered connection factory java:/activemq/ConnectionFactory

          BUT I can not see anything .

          JBoss doesnt register the activeMQ in the container as JNDI.

           

          does anybody have any idea?????

          • 2. Re: ActiveMQ with JBoss 7.1
            Vova Kurilow Newbie

            One more test:

             

            when I copy ironjacamar.xml into META-INF directory of activemq-ra.rar instead of standalone-full.xml configuration, then jboss try to register ConnectionFactory.

            BUT, now JBoss try to register it twice and I have DuplicateServiceException, ConnectionFactory is already register.

             

            I check the standalone-full.xml and removed teh resource-adapter term. The duplicatException is still thrown.

             

            I dont have any idea, what should I configure else on this place.