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.
Well, my workaround right now is adding a Thread.sleep() to the constructor of a subclassed ContextLoaderListener, defined in the web.xml. It will wait until the spring context has been registered in the JNDI... Very ugly hack, but it works fine for now.
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">