I have made a simple project to test the EJB3 implementation.
Using maven I created into the project 3 modules respectively "MyEjb" the EJB, "MyWeb" the war, "MyWeb2" another war. The war module are the client of the EJB.
The problem is that when I deploy the EAR, the console says that there are 3 EJB context created one for each modules. The EJB context of the module MyEjb is not shared between the wars moduls, each of it take the data from each own MyEjb dependency.
I have to create the EJB interfaces in a separate JAR? I use Jboss as application server.
Here the full project: https://github.com/AndreaCatania/EjbTest
Here the console:
[0m[0m09:32:18,735 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named TheNamer in deployment unit deployment "MyEjbs-1.0-SNAPSHOT.jar" are as follows:
java:global/MyEjbs-1.0-SNAPSHOT/TheNamer!com.andreacatania.test.RemoteNamer
java:app/MyEjbs-1.0-SNAPSHOT/TheNamer!com.andreacatania.test.RemoteNamer
java:module/TheNamer!com.andreacatania.test.RemoteNamer
java:jboss/exported/MyEjbs-1.0-SNAPSHOT/TheNamer!com.andreacatania.test.RemoteNamer
java:global/MyEjbs-1.0-SNAPSHOT/TheNamer
java:app/MyEjbs-1.0-SNAPSHOT/TheNamer
java:module/TheNamer
[0m[0m09:32:19,137 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-5) JNDI bindings for session bean named TheNamer in deployment unit deployment "MyWeb.war" are as follows:
java:global/MyWeb/TheNamer!com.andreacatania.test.RemoteNamer
java:app/MyWeb/TheNamer!com.andreacatania.test.RemoteNamer
java:module/TheNamer!com.andreacatania.test.RemoteNamer
java:jboss/exported/MyWeb/TheNamer!com.andreacatania.test.RemoteNamer
java:global/MyWeb/TheNamer
java:app/MyWeb/TheNamer
java:module/TheNamer
[0m[0m09:32:19,142 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-6) JNDI bindings for session bean named TheNamer in deployment unit deployment "MyWeb2.war" are as follows:
java:global/MyWeb2/TheNamer!com.andreacatania.test.RemoteNamer
java:app/MyWeb2/TheNamer!com.andreacatania.test.RemoteNamer
java:module/TheNamer!com.andreacatania.test.RemoteNamer
java:jboss/exported/MyWeb/TheNamer!com.andreacatania.test.RemoteNamer
java:global/MyWeb2/TheNamer
java:app/MyWeb2/TheNamer
java:module/TheNamer