1 Reply Latest reply on Mar 12, 2012 5:12 PM by thinksteep thinksteep

    dependencies between sub-deployments & startup order

    Lars Kral Newbie

      I'm in the process of migrating an application from JBoss 5.1 to JBoss AS 7.1 .


      The application is deployed as an EAR, which consists of at least 2 sub-deployments:




      + META-INF

          + application.xml

          + jboss-app.xml

      + my-ejb.jar

          + META-INF

             + ejb-jar.xml

      + my-service.sar

          + META-INF

             + jboss-service.xml




      Here, the SAR deployment depends on a SLSB inside the EJB deployment, so we used the depends-tag in jboss-service.xml to allow the container (JBoss 5.1) to start the sub-deployments in the correct order:



          <mbean code="mypackage.MyJMXService" ...>






      Now it is not clear to me how to declare this dependency in JBoss AS 7.1 . I tried to set the "initialize-in-order" option in the EAR deployment descriptor.


      Unfortunately I did not find a working example, but from what I read in the schema definition, the following should be valid:



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

      <jboss:jboss-app xmlns:jboss="http://www.jboss.com/xml/ns/javaee"



          xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-app_7_0.xsd

              http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd"













      Anyway, this does not solve my problem, so I get the following exception while a MBean performs some JNDI-Lookup during its start() method:



      java.lang.IllegalArgumentException: Could not find module app: myear module: my-ejb distinct name:



      Can somebody shed some light on this? Probably there is a simpler solution with dependency injection, so I do not need to set "initialize-in-order"?