You need to define the strict deployment as described here
This will deploy the jee modules in the order they have been defined in the application.xml and jboss-app.xml.
Another option would be to rely on the dependencies feature of services in the jboss which is explained over here
I should of mentioned that this problem is occurring on 5.0-GA.
I added jboss-app.xml to the ear META-INF, but I still have the same issue, the EJB-JAR is being deployed first:
<jboss-app> <module-order>strict</module-order> <loader-repository>com.x:archive=my.ear</loader-repository> </jboss-app>
The MDB in the ejb-jar is annotated as such:
I've played around with making that:
but not sure if that would be needed, but didn't work either. Anything in the Deployer xml files for 5.0 I can take a look at?
Try this on your EJB:
import org.jboss.ejb3.annotation.Depends; import org.jboss.ejb3.annotation.ResourceAdapter; @ResourceAdaptor("x.rar") @Depends("jboss.jca:service=RARDeployment,name=x.rar") public class MyEJB...
If that doesn't work please post the entire console logs along with the stacktrace.