0 Replies Latest reply on Apr 25, 2012 6:51 AM by r.reimann

    Deployment ordering seems to ignore optional module dependencies

    r.reimann Newbie

      When i declare an optional module dependency the outcome (ClassNotFoundException vs. success) depends on the deployment order which is documented in the jboss-deployment-structure-1_1.xsd:


              <xsd:attribute name="optional" type="xsd:boolean" use="optional" default="false">
                  <annotation xmlns="http://www.w3.org/2001/XMLSchema">
                          Specifies whether this dependency is optional (defaults to false). An optional dependency will not
                          cause the module to fail to load if not found; however if the module is added later, it will not be
                          retroactively linked into this module's dependency list.


      But during the server start the deployment order is determined by AS7.1.0.Final and optional dependencies (opposed to mandatory ones) are not taken into account for the deployment ordering which leads to ClassNotFoundExceptions since authentication.war is deployed before myapplication.ear.


      Below are the jboss-deployment-structure descriptors i use to expose and reference the dependency:


      myapplication.ear (exposes the module):

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
         <module name="deployment.releasebuild-information" >
               <resource-root path="lib/release-info.jar">


      authentication.war (references the exposed module)

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
               <module name="deployment.releasebuild-information" export="true" optional="true"/>


      As soon as i set optional="false" the deployment order during server start changes and deployment.releasebuild-info ist reachable from within authentication.war. Is the different deployment order depending on the optional flag a bug or am i wrong in expecting to to see the same order for a mandatory and for an existing optional dependency?