Advertise with us

Our eBooks

Configuring JBoss AS 7 deployment order

You can configure JBoss AS deployment order inside an EAR with a simple trick, here we will show how to do it!

If you are using application.xml 6.0 schema you have an handy element named initialize-in-order which, if set to true, initializes the modules in the same order they are listed. For example here the webapp.war will be initialized as first module of the ear:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="" xmlns:xsi=""
  version="6" xsi:schemaLocation="">


What if you need configuring the deployment order between two applications, say two EAR files ? then you can use jboss-deployment-structure.xml.  jboss-deployment-structure.xml is a JBoss specific deployment descriptor that can be used to control class loading in a fine grained manner. It should be placed in the top level deployment, in META-INF (or WEB-INF for web deployments).

For example, let's say you have app1.ear and app2.ear. Here we configured the deployment structure of app2.ear to depend on app1.ear, so that the former will be deployed first:

<?xml version="1.0" encoding="UTF-8"?>
           <module name="deployment.app1.ear" />

Important! If you need to configure a dependency toward one or more EAR files, which are deployed separately, then you need to use jboss-all.xml file as follows:

<jboss umlns="urn:jboss:1.0">
    <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
        <dependency name="application1.ear" />
        <dependency name="application2.ear" />


© 2021 All Rights Reserved.

Please publish modules in offcanvas position.