Look at the Wiki for (scoped) classloading.
You'll have to use a separates classloader for each ear.
could you please give more details?
I think i got the same problem.
My try was to deploy two EAR - Files which use the same classes, ejbs etc.
Now i got the problem, that any of its app always uses the same datasource.
I tried to configure all JNDI Names @ any bean and changed the xml files, so that it now should work.
If i only deploy one package, this package uses the correct database and it works fine.
If i know deploy the second package, this package also uses the datasource of the first package. But if i deploy the second first, it uses the correct database and so on ...
if i try using something like [jboss-service.xml]
<class-loading> <loader-repository> app:loader=App2.ear </loader-repository> </class-loading>
i get the following error-message:
Only the root deployment can set the loader repository
thx a lot