0 Replies Latest reply on Jan 24, 2012 8:59 AM by Ed Keen

    Unable to listen to ActiveMQ queue:  Invalid connection definition

    Ed Keen Newbie

      Configuration:  jboss-as-7.1.0.Final-SNAPSHOT (as of 1/24/2012)

       

      I am trying to get an MDB deployed on JBoss to listen to an ActiveMQ queue.  Utlimately, this ActiveMQ queue will be running on a remote server.  Here is what I have done, just to test this out locally on my workstation:

       

      1.  Installed ActiveMQ locally and created a queue called "amqTest"

      2.  Put the activemq-rar-5.4.3.rar file in standalone/deployments

      3.  Added the following resource adapter info in standalone.xml:

       

              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

            

                 <resource-adapters>

                      <resource-adapter>

                          <archive>activemq-rar-5.4.3.rar</archive>

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

                          <config-property name="ServerUrl">tcp://localhost:61616</config-property>

                          <connection-definitions>

                              <connection-definition class-name="javax.jms.QueueConnectionFactory" jndi-name="java:jboss/activemq/QueueConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQQueueConnectionPool" use-ccm="true">

                                  <config-property name="ServerUrl">vm://localhost</config-property>

                                  <pool>

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

                                      <max-pool-size>200</max-pool-size>

                                      <prefill>true</prefill>

                                      <use-strict-min>true</use-strict-min>

                                  </pool>

                              </connection-definition>

                          </connection-definitions>

                                              </resource-adapter>      

                        </resource-adapters>

            

                       

              </subsystem>

       

      4.  Created an MDB with the following annotations:

       

      @MessageDriven(name="TestAQService", activationConfig = {

                          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

                          @ActivationConfigProperty(propertyName = "destination",     propertyValue = "queue/amqTest") })

      @TransactionManagement(value= TransactionManagementType.CONTAINER)

      @TransactionAttribute(value= TransactionAttributeType.REQUIRED)

      @ResourceAdapter("activemq-rar-5.4.3.rar")

       

       

      When I start JBoss with these changes, I get the following warning:

       

      WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] IJ020009: Invalid connection definition with class-name: javax.jms.QueueConnectionFactory

       

      Note:  I did not make any changes to the ra.xml file contained in activemq-rar-5.4.3.rar.  When I open ra.xml, I find the following connection-definition that seems to pertain to the above warning:

       

              <outbound-resourceadapter>

                  <connection-definition>

                      <managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>

                      <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>

                      <connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>

                      <connection-interface>javax.jms.Connection</connection-interface>

                      <connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>

                  </connection-definition>

       

      Is this correct, or do I need to modify something inside the rar file in order for this to work?

       

      When I dropped a test message on the ActiveMQ queue, my JBoss MDB did not respond, so I must still be missing something.  Please let me know if I have missed anything.

       

      Thanks,

      Ed