How do you configure your .war to be deployed after your EJB ?

jboss recipe of the day
A common requirement for some web application is to initialize some data with Context Listeners as soon as the application is deployed. If the Context Listener tries to access some other deployed units, it is necessary to deploy the .war file after the other deployed units.

The simplest way to do it, is adding a dependency in the jboss-web.xml file which is deployed along with the web application:

<jboss-web>
 
 <depends>jboss.j2ee:module="myEJB.jar",service=EjbModule</depends>
 
</jboss-web>