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

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

      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



        • 1. Re: Multiple EAR deployment not working as documented (at al
          jaikiran

           

          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.


          --- 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.



          Which version of JBossAS do you use? And are those EJB2.x beans? If yes, then it looks related to https://jira.jboss.org/jira/browse/JBAS-6335, which is marked as fixed in 5.0.1 GA and 5.1.0 Beta1 of the AS


          • 2. Re: Multiple EAR deployment not working as documented (at al

            Thank you for your reply. I am using JBoss 4.0.4.GA and EJB 2.1. I have looked at the bug report you pointed me at but it mentions that it is a bug in 5.0, and I am using 4.0.4. I suppose that just because it was reported in 5.0 doesn't mean it isn't a problem in 4.0.4 as well?

            Thanks,
            Paul

            • 3. Re: Multiple EAR deployment not working as documented (at al
              jaikiran

              I am not sure whether that bug existed even in 4.0.4. But based on the comments from the user, in the referenced forum thread in that JIRA:

              This was working fine in version 4.2.2 GA


              So you could give 4.2.2 or 4.2.3 GA a try.

              You did not post the entire exception stacktrace and the relevant console logs, so i am guessing its the same issue. Please post these details, and let's see if it's something else.