The file you are asking for is $JBOSS_HOME/server/$PROFILE/deployers/spring.deployer/META-INF/spring-deployers-jboss-beans.xml .
(or spring.deployer/META-INF/spring-deployers-jboss-beans.xml in the distribution).
You can set the relativeOrder property on the ApplicationContextDeployer bean - lower values have higher precedence.
thank you very much for the tip. But even if I modify the file to read
<bean name="ApplicationContextDeployer" class="org.jboss.spring.deployers.ApplicationContextDeployer">
It still starts before the PersistenceUnit deployment. If I comment this bean, JPA starts as expected. I'm not sure if BeanFactoryDeployer could help me but uncommenting it doesn't seem to do anything.
Are there any other dependency mechanisms that could block PU deployment from running?
I am encountering the same problem now -- an application that uses JPA and Spring works in JBoss 5.1, but fails to load under JBoss 6.0.0. Under 5.1, the first thing that happens when the app deploys is the loading of the Perssitence unit from persistence.xml
In JBoss 6.0, on the other hand, the application context loads first, and this fails because it depends on the persistence unit.
I tried the "relativeOrder" modification, as illustrated by Marcus in this thread, but that didn't seem to make any difference.
Is there any more information on this issue?
Well, I haven't spend time on application server integration lately, as my application is neither a web-app nor so complex that it doesn't work with a standalone application context...
And while I couldn't get it to work on JBoss AS 6, I'm wondering if maybe JBoss AS 7 would be an option for you? Marius' latest blog post suggests that Spring applications work very well on it.
All the best