I am trying to specify deployment order inside an EAR (JBoss 5.1.0). The EAR contains a WAR, JARs, and Spring artifacts (.Spring archives). I list the .EAR file modules inside the /myEar.ear/META-INF/application.xml file. Then I place "<module-order>strict</module-order>" inside the /myEar.ear/META-INF/jboss-app.xml file. JBoss will then deploy the .EAR contents in the order specified in the application.xml. This works with the WARs and JARs; however, when I put Spring artifacts inside the .EAR, JBoss doesnt adhere to the "<module-order>strict</module-order>". Is there something special I need to do with Spring archives. How do you specify order with .Spring, WARs, and JARs inside an EAR?
I am also interested in how to solve this. I would suspect I have a pretty basic use case, using JBoss 7.1.1, Snowdrop 2.0.2 and Spring 3.1.1. My application in it's simplest form looks like this:
| +- MANIFEST.MF
| +- application.xml
| +- spring-3.1.1-jars.jar
| +- other-jars.jar
My .war has a beanRefContext.xml that is trying to lookup the JNDI name that the SpringDeployer should have registered, which fails because the JNDI name is not found. There is also some randomness attached to this because for a while it did actually work, the JNDI name was found and deployment continued. I then copied some .jars on the JBoss servers, which I suspect might have modified their timestamps or something similar, in case that's one of the factors for deciding deployment order, and after that it has stopped working.
My application.xml file looks like this:
I can't managed to get this working... My company is using JBoss 4.2 and there it is working fine, but we are figuring it's time to upgrade. I don't really need to keep the same deployment structure either it's just that I want a main Spring context to be deployed that other WAR's (and also MDB's) can access.
This may or may not help, but in my case, I had some Spring-configured object which depended on JNDI. What I did was delay the deployment of the whole spring-deployer before the bean which implements JNDI naming. JBoss does have a <depends/> tag for stating dependency on a service, but that's for the mbean schema, besides, I suppose that service names, themselves depend on the Naming service. In any case, the deployment schema also has <depends/>, but unlike the mbean schema, the deployment schema's "depends" refers to bean names, rather then service names. So I modified the spring-deployer deployment descriptor (spring-deployer/META-INF/spring-deployers-jboss-beans.xml) such that it's two bean declarations are:
<bean name="SpringParserDeployer" class="org.jboss.spring.deployers.vfs3.SpringParserDeployer">
<bean name="ApplicationContextDeployer" class="org.jboss.spring.deployers.ApplicationContextDeployer">