Refer to the org.jboss.deployment.scanner.PrefixDeploymentSorter and its description in conf/jboss-service.xml of your JBoss instance. You can force deployment order through this rather than the default deployment strategy. However, it seems a better idea to have the shared libraries placed in the SAR rather than the EAR (unless you would foresee deploying the EAR without the SAR).
so if i always deploy the EAR with the SAR what's the right format? I've tried this but my servlet in myServlet.WARfailed to load due to ClassNotFoundException
+-- META-INF (Dir)
If you are going to deploy them as separate units, i mean have a FOO.sar and FOO.ear(that has the ejb components), you can put in a "depends" on the jboss-service.xml of ur SAR file, like,
Look at any of the -service.xml files for the exact syntax.
And loading classes from SAR to EAR shouldnt be a problem as its a flat structure for all classes in deploy directory.
Let me know if it works. Ive to try a similar thing that im planning on doing today.
I ended up deploying this way.
FOO.EAR as a directory
FOO.SAR as a directory
and inside jboss-service.xml, i added a classpath
The only outstanding question now is I need
foo.sar to depend on a (load on startup=1) servlet (not EJB) inside myServlet.war.
Is that possible and if yes what JNDI name do i use to reference the servlet in my element?
Don't know if it is possible as I haven't tried referencing a servlet. Someone was doing this on the mailing list but had problems from what I remember.
If you use the jmx-console, you can see the domain and naming used for deployed services. You'll see a match for your EJB (jboss.j2ee:jndiName=...,service=EJB) on which you were going to make your depend. You can get your servlet information from there. I guess give it a try as the system encourages experimentation.
Doesn't look like it's possible to have the SAR depends on a servlet. but reading over the documentation again, it says that SAR is deployed nested depth first. So in theory, if i have
FOO.EAR should deploy first before deploying fully deploying anything mentioned in META-INF/jboss-service.xml
Looks like that is working it only works AFTER JBoss has finished starting up. (ie. startup JBoss, then drop in directory FOO.SAR). OTherwise, the EJB in FOO.EAR fails to deploy b/c it requires jboss:service=invoker,type=jrmp.
MBeans waiting for other MBeans:
I Depend On:
Depends On Me: java.lang.RuntimeException: invoker is null: jboss:service=invoker,type=jrmp]