3 Replies Latest reply on Jan 19, 2010 4:33 AM by Damian Sinczak

    JBoss 5 - MDB and ActiveMQ, can't get to work together

    Damian Sinczak Newbie

      Hi,

       

      I have tried to configure JBoss 5 to work with ActiveMq 5. I tried to base on clues from post: http://community.jboss.org/thread/48761?start=0&tstart=0 but I can't get it work. I have checked with version 4 of jboss and everything works correctly. Exception I'm getting:

       

      [14:36:41] Łukasz Torzyński: 14:36:00,312 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=nlt-service-logic-components-ejb.jar,name=TestService,servi
      ce=EJB3) to KernelDeployment of: nlt-service-logic-components-ejb.jar
      14:36:00,359 INFO  [EJBContainer] STARTED EJB: com.nokia.nlt.services.impl.TestService ejbName: TestService
      14:36:01,828 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1ef
      b813(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@125c9a4 destination=queue.outbound destinationType=javax.jms.Q
      ueue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSessio
      n=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queu
      e/DLQ DLQUser=null DLQMaxResent=5)
      javax.naming.NameNotFoundException: queue.outbound not bound
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
              at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
              at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at org.jboss.util.naming.Util.lookup(Util.java:222)
              at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
              at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
              at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
              at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213)
              at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)

       

       

      My activemq-jms-ds.xml datasource file:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE connection-factories
          PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
          "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

      <connection-factories

      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
                name="jboss.messaging:service=JMSProviderLoader,name=ActiveMQJMSProvider">
            <attribute name="ProviderName">ActiveMQJMSProvider</attribute>
            <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
            <attribute name="FactoryRef">java:activemq/ConnectionFactory</attribute>
            <attribute name="QueueFactoryRef">java:activemq/ConnectionFactory</attribute>
            <attribute name="TopicFactoryRef">java:activemq/ConnectionFactory</attribute>
         </mbean>


      <tx-connection-factory>
            <jndi-name>activemq/ConnectionFactory</jndi-name>
            <xa-transaction/>
            <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing this one out! -->
            <rar-name>activemq-rar-5.3.0.rar</rar-name>

            <connection-definition>javax.jms.ConnectionFactory</connection-definition>
            <security-domain-and-application>JmsXARealm</security-domain-and-application>
         </tx-connection-factory>


      <tx-connection-factory>
            <jndi-name>activemq/QueueConnectionFactory</jndi-name>
            <xa-transaction/>
            <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing this one out! -->
            <rar-name>activemq-rar-5.3.0.rar</rar-name>

            <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
            <security-domain-and-application>JmsXARealm</security-domain-and-application>
         </tx-connection-factory>

         <tx-connection-factory>
            <jndi-name>activemq/TopicConnectionFactory</jndi-name>
            <xa-transaction/>
            <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing this one out too! -->

            <rar-name>activemq-rar-5.3.0.rar</rar-name>
            <connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
            <security-domain-and-application>JmsXARealm</security-domain-and-application>
         </tx-connection-factory>

         <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=nltQueue">
            <attribute name="JNDIName">activemq/queue/nltQueue</attribute>

            <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-5.3.0.rar'</depends>
            <attribute name="Type">javax.jms.Queue</attribute>
            <attribute name="Properties">
                  PhysicalName=nltQueue
            </attribute>
         </mbean>
        
         <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=nltResponseQueue">
            <attribute name="JNDIName">activemq/queue/nltResponseQueue</attribute>

            <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-5.3.0.rar'</depends>
            <attribute name="Type">javax.jms.Queue</attribute>
            <attribute name="Properties">
                  PhysicalName=nltResponseQueue
            </attribute>
         </mbean>
        
         <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=outboundQueue">
      <attribute name="JNDIName">activemq/queue/outbound</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-5.3.0.rar'  </depends>
      <attribute name="Type">javax.jms.Queue</attribute>
      <attribute name="Properties">
      PhysicalName=queue.outbound
      </attribute>
      </mbean>

        
        
       

      </connection-factories>

      >

       

      MDB annotations:

       

      @MessageDriven(mappedName = "jms/SimpleMessageReceiverBean", activationConfig = {
         @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
         @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
         @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue.outbound")
        })
      @ResourceAdapter("activemq-rar-5.3.0.rar")
      public class TestService implements MessageListener {

      @Override
      public void onMessage(Message arg0) {
        // TODO Auto-generated method stub

      }

      }

      JBoss 5 - MDB and ActiveMQ, can't get to work togetherJBoss 5 - MDB and ActiveMQ, can't get to work together