i created 2 datasouce files xxx-ds.xml yyy-ds.xml both connect to different database both have different <jndi-name> xxxx </jndi-name> names
i've searched in jar files for ejb-jar.xml for the jndi name to make sure i don't have the same name for my datasources. i've searched the jboss-app.xml to make sure the <loader-repository> is looking at the correct ear. But now i'm clutching at straws
When i deploy the ears separately there is no problem. i'm missing something, i just know don't where to look or what to look for
I have 2 ear files both have the abc.jar file (which inc. the ejb-jar.xml file)
ear 1 points to abc database ear 2 points to def database
I need to use the same abc.jar in both ears. Are you saying I have to duplicate the code for the jar file changing the ejb-jar.xml in each of the jars?
jboss allows you to isolate classloaders of every ear file. In that case both ears will be independent and you can reuse the same code. as it is described in jboss wiki http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration: ----------- There are two levels of scoping, isolation from other deployments, and isolation that overrides the loading of JBoss server classes. With nested modules, only the top level file may specify class loader scoping. If you have a .ear file containing other modules, only scoping specified in the .ear's META-INF/jboss-app.xml is used. This also applies for any other deployment which contains sub-deployments. For example, if a .sar contains a .war deployment, only the .sar META-INF/jboss-service.xml scoping has effect.
Specifying Isolation
For .ear files, in your jboss-app.xml, add the following descriptor fragment construct to enabled scoped class loading: