3 Replies Latest reply on Oct 3, 2008 7:24 AM by jinpsu

    Configure Queue from EAR

      So I'm using JBoss 4.2.2.GA to create a handful of MDB's. I'm using the @MessageDriven annotation to configure the destination for the bean. Can I provide a *-service.xml in an EAR to create the Queue?

      I tried putting the following in myEar/META-INF/jboss-destinations-service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=queue/mdb">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
       </mbean>
      </server
      


      However, that doesn't seem to work because I still see this debug when my EAR is deployed to JBoss:
      WARN [MessagingContainer] [main] Could not find the queue destination-jndi-name=queue/mdb
      WARN [MessagingContainer] [main] destination not found: queue/mdb reason: javax.naming.NameNotFoundException: command not bound
      WARN [MessagingContainer] [main] creating a new temporary destination: queue/mdb
      


      Everything still works, but I would like to avoid JBoss creating a temporary destination and configure the Queue from within my EAR.

      What am I missing?

      Thanks.

      justin

        • 1. Re: Configure Queue from EAR

          I forgot to mention that my application is scoped. My META-INF/jboss-app.xml contains:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
           "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
          <jboss-app>
           <loader-repository>
           net.app:archive=ear
           <loader-repository-config> java2ParentDelegation=false
           </loader-repository-config>
           </loader-repository>
          </jboss-app>
          


          I tried to do something similiar in META-INF/jboss-destinations-service.xml but it had no effect:
          <?xml version="1.0" encoding="UTF-8"?>
          <server>
           <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
           <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
           </loader-repository>
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=queue/mdb">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
          </server>
          


          • 2. Re: Configure Queue from EAR

            Oh, and I just realized that specifying a name of "queue/mdb" will actually create the queue "queue/queue/mdb". The name should read just "mdb".

            However, it's still just ignoring my META-INF/jboss-destinations-service.xml, so I still don't know what's going on.

            • 3. Re: Configure Queue from EAR

              Nevermind, got it working now. Had to put the destinations file in the root of the ear and referenced it as a service module in jboss-app.xml.