5 Replies Latest reply on Mar 7, 2012 3:58 AM by striantafyllou

    JBoss AS 7.1.0.CR1 Initialization order of EAR's modules problem

    striantafyllou

      Hi,

       

      I am deploying an ear in Jboss AS 7.1.0.CR1 which contains a spring module (astroboa-engine.spring) and an EJB module (astroboa-ejb3.jar) and I would like

      them to be initialized in the order they are mentioned.

       

      I have specified initialize-in-order parameter to be "true" in the application.xml

       

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

      <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">

        <description>This modules is responsible to generate Astroboa EAR</description>

        <display-name>astroboa-ear</display-name>

        <initialize-in-order>true</initialize-in-order>

        <module>

          <java>astroboa-engine.spring</java>

        </module>

        <module>

          <ejb>astroboa-ejb3.jar</ejb>

        </module>

        <library-directory>lib</library-directory>

      </application>

       

      I have also specified the module-order parameter in jboss-app.xml

       

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

      <!DOCTYPE jboss-app PUBLIC

              "-//JBoss//DTD Java EE Application 5.0//EN"

              "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">

      <jboss-app>

        <module-order>strict</module-order>

      </jboss-app>

       

      and finally I have even provided a jboss-deployment-structure.xml file where I declare that the EJB module depends on

      the spring module.

       

       

      <jboss-deployment-structure>

        <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

        <sub-deployment name="astroboa-engine.spring">

              <dependencies>

              <module name="org.apache.xerces" />

              </dependencies>

        </sub-deployment>

        <sub-deployment name="astroboa-ejb3.jar">

              <dependencies>

                   <module name="deployment.astroboa.ear.astroboa-engine.spring" />

              </dependencies>

        </sub-deployment>

       

      </jboss-deployment-structure>

       

      JBoss AS seems to ignore all the above and deploys the two modules at the same time. 

      I have been searching for something similar without any luck.

       

      I have only come across with the issue https://issues.jboss.org/browse/AS7-3078 and

      I have looked at the application.xml of the test case for this issue where the ear consists of a war and an ejb module. Since this issue has been

      resolved and the test case is very similar to my case, I believe that there is something wrong with the initialization order when it comes

      for spring modules.

       

      Any hint would be appreciated!