You have to configure a different loader-repository for every deployment unit and isolate them agains each other (if every deployment unit has all the resoureces needed with it!).
Every invocation from the war to your ejbs will go through marshalling and you won't have any problems with classloaders.
If you want to share resources, you have to redeploy all involved deployment units.
I now added a jboss-app.xml to the ear's META-INF, with the following content:
<jboss-app> <loader-repository>mycompany.com:loader=myear.ear</loader-repository> </jboss-app>
However, when deploying the ear, I now get:
15:30:41,322 ERROR [Engine] StandardContext[/mycontext]: Exception starting filter MyFilter
event though the commons-logging package is contained in the ear's war as well as in the ear's jar.
Any help on how the loader-repository must be configured correctly would be appreciated.