AGAIN: two EARs deployment with one EJB3 core logic
maksymus Nov 24, 2005 4:38 AMHello all.
This problem is fully described in other forum branches, BUT the the problem still exists.
I need to deploy two EAR files, that contain the same EJB3 module (with different names) into one JBoss instance (4.0.3)
First project's jboss-app.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app
PUBLIC "-//JBoss//DTD J2EE Application 1.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>iTest:loader=test.ear
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
<jmx-name>test.ear:name=iTest</jmx-name>
</jboss-app>
Second project's jboss-app.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app
PUBLIC "-//JBoss//DTD J2EE Application 1.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>iTutorial:loader=tutorial.ear
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
<jmx-name>tutorial.ear:name=iTutorial</jmx-name>
</jboss-app>
After deployment of those EARs (Test first, then Tutorial) I get following exception:
==============================================
2005-11-24 11:00:41,938 INFO [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=com.tutorial.session.AuthorSessionBean, class=com.tutorial.session.AuthorSessionBean, type=STATELESS
2005-11-24 11:00:41,938 DEBUG [org.jboss.ejb3.Ejb3Deployment] Bound ejb3 container jboss.j2ee:service=EJB3,name=com.tutorial.session.AuthorSessionBean
2005-11-24 11:00:41,941 INFO [org.jboss.ejb3.stateless.StatelessManager] Registration is not done -> stop
2005-11-24 11:00:41,941 DEBUG [org.jboss.ejb3.Ejb3Module] Initialization failed jboss.j2ee:service=EJB3,module=tutorial.ejb3
javax.management.InstanceAlreadyExistsException:
jboss.j2ee:service=EJB3,name=com.tutorial.session.AuthorSessionBean already registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:755)
==============================================
SO the problem IS that jboss-app.xml does not make the JBoss to load each module with beans separately.
In all cases, with all jboss-app.xml files it stil tries to register in both cases com.tutorial.session.AuthorSessionBean !!
So I need some practical solution for the naming conversion or aliasing.
Please, notice in the exception the following line:
jboss.j2ee:service=EJB3,name=...
Not "jndiName", but "name" !
Every suggestions that I have read before posting this conserned JNDI topic.
Also, there is ear-deployer.xml file, which "Isolated" option I set into "true".
Thank you all for your responces.