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

This tutorial has been written for an old version of JBoss which is now deprecated.
We recommend checking this resource to learn how to configure the order of deployment between applications: Simple way to configure JBoss / WildFly deployment order

Deployment order configuration for JBoss AS 5

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: