I have 2 ejb modules (2 x ejb jar files) each with only 1 EJB.
I deploy each module to the same managed server but it seems I cannot use the local interfaces to call 1 EJB from the other.
I thought this would be ok because these bean will run in the same JVM.
Can someone explain why I must use the remote interfaces? Did I do something wrong?
In order for your beans to communicate throufg the local interfaces, two conditions (at least these two I remember :-)) must be met:
They both must run within the same jvm (which your deployment architecture meets).
They both must be loaded by the same classloader (which almost certainly your deployment architecture doesn�t meet).
In order to fix this issue repack both ejb.jars within an ear and redeploy them to the cluster (or any managed instance if you wish � and by the way, why would you do this? :-)). By J2EE specification this should work for any container. Another solution that might work is to add those classes to the system classpath, but this is an extremely bad practice and it could not be supported by all containers (check your container�s classloading architecture by the way). Regards.