How to order deployment of EJBs and JMS queue config in JBoss 5?

I'm using JBoss [EAP] 5.0.0.GA and I have an EAR which contains an EJB jar that contains some MDBs which depend on the existence of the JMS queues that they use. When I configured the queues in .../server/all/deploy/messaging/myqueues-service.xml there was no problem.

However, I wanted to configure the queues in the EAR file to avoid having to make changes to the JBoss config directly. No problem, I put my myqueues-service.xml file into the root of the EAR and added the reference to my jboss-app.xml as follows:

<jboss-app>
    <module-order>strict</module-order>
    <loader-repository>
        seam.jboss.org:loader=my-ear.ear
    </loader-repository>
    <module>
        <service>myqueues-service.xml</service>
    </module>
</jboss-app>

However, when I do that, JBoss loads the EJB jar (contained in my-ear.ear) first and then configures the JMS Queues afterwards. This results in errors when the MDB are loaded:

12:16:02,714 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@13a59e .....
javax.naming.NameNotFoundException: MyQueue not bound

It's not a huge problem, as later on the MDBs successfully reconnect to JMS:

12:16:12,698 INFO  [JmsActivation] Attempting to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@f91ad5
12:16:12,823 INFO  [JmsActivation] Reconnected with messaging provider.

But I'd really like to avoid having any errors, and in order to do that I need a way to force JBoss to configure the JMS queues first, before loading the EJB jar. Is there any way to do this? For reference, here's the application.xml for the EAR:

<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
  <display-name>my-ear</display-name>
  <module>
    <ejb>my-ejb.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>my.war</web-uri>
      <context-root>myroot</context-root>
    </web>
  </module>
</application>

Any suggestions appreciated.

5
задан mluisbrown 6 January 2011 в 14:40
поделиться