2 Replies Latest reply on May 18, 2009 7:54 AM by Adam Michalik

    Configuring JMS queue on JBoss AS 5

    Adam Michalik Newbie

      I was following the Sam guide and tried to set up a JMS queue according to this chapter:
      http://docs.jboss.com/seam/latest/reference/en-US/html/jms.html


      I added:


      <jms:managed-queue-sender name="mailQueueSender" auto-create="true" queue-jndi-name="queue/mailQueue"/>



      (jms namespace declared as xmlns:jms="http://jboss.com/products/seam/jms")


      to my components.xml file and tried running it on JBoss AS 5 (through Eclipse, using Seam Tools 3.0.1). However, the queue does not show up in the JNDI tree. I added


      <jms:queue-connection queue-connection-factory-jndi-name="/ConnectionFactory" />



      to components.xml as I found that JBoss AS 5 is using JBoss Messaging instead JBoss MQ - no effect. The queue is never started according to the JBoss server logs - no QueueService message about that. My MDB that should be handling the queue is declared as such:


      @Name("mailSender")
      @MessageDriven(activationConfig={
                @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
                @ActivationConfigProperty(propertyName="destination", propertyValue="queue/mailQueue")
      })
      public class MailSender implements MessageListener {
      ...



      and deploying it results in


      17:13:18,131 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@c5d21e(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@27d8b4 destination=queue/mailQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      javax.naming.NameNotFoundException: mailQueue not bound



      Is there anything more I need to do?

        • 1. Re: Configuring JMS queue on JBoss AS 5
          Nikolay Elenkov Master

          Adam Michalik wrote on May 17, 2009 17:42:


          Is there anything more I need to do?


          Yes, you need to create the queue. Seam creates manged components to help you send messages (Session, Connection, etc),
          but it doesn't create the queue for you. You have to put a file defining your queue(s) in your deploy directory. Check the JBoss 5
          manual for details.


          HTH



          • 2. Re: Configuring JMS queue on JBoss AS 5
            Adam Michalik Newbie

            Ah, OK, thanks a lot. For future reference:
            this post helped me too (although it concerns JBoss MQ, not JBoss Messaging):


            http://www.seamframework.org/Community/ConfiguringJmsInComponentsxmlForEmbeddedJboss


            In the JBoss deploy dir you need a <xxx>-destinations-service.xml descriptor with the following contents:


            <?xml version="1.0" encoding="UTF-8"?>
            <server>
                 <mbean code="org.jboss.jms.server.destination.QueueService"
                      name="jboss.messaging.destination:service=Queue,name=<your queue name here without the "queue/" prefix>"
                      xmbean-dd="xmdesc/Queue-xmbean.xml">
                      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                      <depends>jboss.messaging:service=PostOffice</depends>
                 </mbean>
            </server>



            For another example see deploy/messaging/destinations-service.xml