You'll have to explicitly mark dependencies (using JBoss specific descriptor files) between those .ear files. I need to take a look at which file the dependencies need to be specified in for AS-5 (and what the dependency looks like). In the meantime do a forum search in the JBoss AS user forum http://community.jboss.org/community/jbossas and see if you can find something useful. I remember there were some discussions around this.
thanks Jaikiran, from the link you sent and some more digging, it seems that there are 2 options
1. have the names of the ear files prefixed by some numbering. In my case, prefixing the names as 1eac.ear, 2jms.ear, 3edesk.ear, 4publish.ear resulted in the correct start order. The only issue was that naming the ear files correctly was kind of a hacky way of fixing this.
2. create some dependencies between modules. It seems that the war modules support a jboss-web.xml configuration fille, which could contain <depends> tags. In my case, since jms depends on eac, and edesk and publish depend on both jms and eac, I included the following:
- for the jms.ear/jms.war/WEB-INF/jboss-web.xml<?xml version="1.0" encoding="utf-8"?><jboss-web><!-- Make the webapp dependent of the deployment of the eac --><depends>jboss.web.deployment:war=/eac</depends></jboss-web>
- for edesk and publish
<?xml version="1.0" encoding="utf-8"?>
<!-- Make the webapp dependent of the deployment of the eac and jms -->
up to now, it seems that is ok, the start order is correct. Hope I'm not screwing anything else up...