I currently have a J2EE project containing EJB and WAR. Everything is going well, as long as I have only one WAR and one EJB module included in the final EAR. Now I need to develop another WAR using the same EJB module.
So, I added the EJB module to the library of the new WAR. The problem is that when I try to deploy an EAR bundled with two WARs and a shared EJB, I get the following exception:
Caused by: java.lang.RuntimeException: Error while binding JNDI name com.alex.ejb.MyBeanRemote__3_x_Internal_RemoteBusinessHome__ for EJB : MyBean
When I remove the EJB from the library of the second WAR, everything works again.
Is there something I missed?
Finally, the real question is: "How to share EJB in multiple web applications?"
thanks for the help
source
share