3 Replies Latest reply on Nov 29, 2006 5:27 AM by jaikiran pai

    deployment order of modules within an EAR

    wqtjboss Newbie

      Hi,

      I noticed by default the EJB modules in an EAR are deployed before WEB modules. That is, even if I specify a WEB module before an EJB module in teh application.xml, the EJB is still deployed first.

      Is there a way to change the default deployment order? Why doesn't JBoss honor the order in which modules are specified in application.xml?

      Thanks,
      Qingtian

        • 1. Re: deployment order of modules within an EAR
          Peter Johnson Master

          I have seen a statement (in AOP, I believe) that in 4.05 JBoss deploys modules in the order in which they appear in application.xml.

          • 2. Re: deployment order of modules within an EAR
            Alex Newbie

            Read more about the jboss-service.xml

            C:\jboss-4.0.2\server\default\conf\jboss-service.xml
            ...
             <!-- ==================================================================== -->
             <!-- Deployment Scanning -->
             <!-- ==================================================================== -->
            
             <!-- An mbean for hot deployment/undeployment of archives.
             -->
             <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
             name="jboss.deployment:type=DeploymentScanner,flavor=URL">
            
             <!-- Uncomment (and comment/remove version below) to enable usage of the
             DeploymentCache
             <depends optional-attribute-name="Deployer">jboss.deployment:type=DeploymentCache</depends>
             -->
             <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
            
             <!-- The URLComparator can be used to specify a deployment ordering
             for deployments found in a scanned directory. The class specified
             must be an implementation of java.util.Comparator, it must be able
             to compare two URL objects, and it must have a no-arg constructor.
             Two deployment comparators are shipped with JBoss:
             - org.jboss.deployment.DeploymentSorter
             Sorts by file extension, as follows:
             "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
             "*"
             - org.jboss.deployment.scanner.PrefixDeploymentSorter
             If the name portion of the url begins with 1 or more digits, those
             digits are converted to an int (ignoring leading zeroes), and
             files are deployed in that order. Files that do not start with
             any digits will be deployed first, and they will be sorted by
             extension as above with DeploymentSorter.
             -->
             <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
             <!--
             <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
             -->
            


            Regards,
            Alex

            • 3. Re: deployment order of modules within an EAR
              jaikiran pai Master

              PeterJ is right, the ordering within an ear was supposed to be based on the order in which the modules have been mentioned in the application.xml. However, looks like this was broken sometime back as per this issue:

              http://jira.jboss.com/jira/browse/JBAS-2904

              Related discussion:

              http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78376