3 Replies Latest reply on Apr 7, 2009 10:35 AM by jaikiran pai

    Multiple EAR deployment not working as documented (at all !)

    Paul Smith Newbie

      I have 2 EARs that I wish to deploy in the same JBoss configuration. The EARs have identical contents except for the conf/log4j.xml file, the MySQL datasource file, and the META-INF/jboss-app.xml file. One of the files in each of the EARs is a JAR file (config.jar) containing POJOs and EJBs. config.jar is in the root level of the EARs.

      When I deploy the EARs I get the error:


      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:module=config.jar,uid=31702491,service=EjbModule
      State: FAILED
      Reason: javax.management.InstanceAlreadyExistsException: jboss.j2ee:jndiName=ejb/CustBean,service=EJB already registered.

      This article http://www.jboss.org/community/docs/DOC-9288 and others I have found led me to make the changes:
      myear1.ear: META-INF/jboss-app.xml
      <jboss-app>
       <loader-repository>com.mycompany:loader=myear1.ear</loader-repository>
      </jboss-app>
      
      myear2.ear: META-INF/jboss-app.xml
      <jboss-app>
       <loader-repository>com.mycompany:loader=myear2.ear</loader-repository>
      </jboss-app>
      

      Section 2.2.2.4.2 of the documentation found here http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch2.chapter.html confirms what I have done is correct.

      In default/deploy, my ear-deployer.xml has the contents:
      <server>
       <mbean code="org.jboss.deployment.EARDeployer"
       name="jboss.j2ee:service=EARDeployer">
       <attribute name="Isolated">true</attribute>
       <attribute name="CallByValue">false</attribute>
       </mbean>
      </server>
      

      The EARs have identical META-INF/application.xml files with contents:
       <module>
       <web>
       <web-uri>eartest_w.war</web-uri>
       <context-root>test_root_ctx</context-root>
       </web>
       </module>
      
       <module>
       <java>config.jar</java>
       </module>
      

      I want only one code base, and so having different JNDI names for my beans in each copy of config.jar is not something I want to do. The articles I have read suggest that what I want to do is possible, but I am clearly missing something. Any help therefore greatly appreciated!

      Thanks,
      Paul