I have an ear that contains two ejb modules with identical code but different descriptors (they are pointed to different database with the same structure). Of course, all beans has unique jndi names.
The ear contains 3 jar. - code.jar (containes all classes) - ejb-module1.jar, ejb-module2.jar that are referencing to code.jar through ClassPath.
First module try to reference to beans from the second one. But in fact it's pointed to its own beans. All beans inside each module use ejb-link. When I remove couple of them, part of the second module beans became available. But it's very unstable and can change every new request.
What work - get second module session bean through remote interface. What doesn't work - to get second module entity beans through local interface.
It looks like a complex JNDI bug, when you have a few identical ejb-modules in one ear.