9 Replies Latest reply on Dec 7, 2009 4:58 AM by jaikiran pai

    EjbModule is already installed JBossAS-5.0.0.GA

    Henrik Lindell Newbie

      Upgrading from 4.2.2 GA to JBossAS-5.0.0.GA. We are deploying different versions of our EARs and need to have them running together. The different versions of the ear files have unique file names but the ejb 2.x jars inside have the same names.
      This was working fine in version 4.2.2 GA (and also on WLS).

      When deploying 2 EARs containing each an ejb 2.x jar with the same name ("my-ejbs.jar") deployment fails with this stack trace when the second is handled by the EjbDeployer.
      The BasicMBeanRegistry tries to register them both with the name "jboss.j2ee:module="my-ejbs.jar",service=EjbModule"

      14:33:27,796 WARN [AbstractDeploymentContext] Unable to register deployment mbean jboss.j2ee:module="my-ejbs.jar",service=EjbModule
      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="jboss.j2ee:module="my-ejbs.jar",service=EjbModule",type=Component already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.addComponent(AbstractDeploymentContext.java:719)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.addComponent(AbstractDeploymentUnit.java:249)
      at org.jboss.system.deployers.ServiceDeploymentDeployer.addServiceComponent(ServiceDeploymentDeployer.java:62)
      at org.jboss.system.deployers.ServiceDeploymentDeployer$ServiceMetaDataVisitor.deploy(ServiceDeploymentDeployer.java:150)
      at org.jboss.system.deployers.ServiceDeploymentDeployer$ServiceMetaDataVisitor.deploy(ServiceDeploymentDeployer.java:141)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
      at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.deployComponents(AbstractComponentDeployer.java:102)
      at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.internalDeploy(AbstractComponentDeployer.java:82)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
      at org.jboss.Main.boot(Main.java:209)
      at org.jboss.Main$1.run(Main.java:547)
      at java.lang.Thread.run(Thread.java:619)
      14:33:27,828 INFO [TomcatDeployment] deploy, ctxPath=/abc-6-0-4, vfsUrl=my-ear-6-0-4.ear/webApp.war
      14:33:28,046 WARN [TomcatDeployment] Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperMBean
      14:33:28,125 INFO [EjbModule] Deploying AbcSLS
      14:33:28,203 INFO [ProxyFactory] Bound EJB Home 'AbcSLS' to jndi 'xyz/abc-6-0-4/internal/ejb/session/Abc'
      14:33:28,218 INFO [ProxyFactory] Unbind EJB Home 'AbcSLS' from jndi 'xyz/abc-6-0-4/internal/ejb/session/Abc'
      14:33:28,218 INFO [EjbModule] Undeployed AbcSLS
      14:33:28,218 INFO [TomcatDeployment] undeploy, ctxPath=/abc-6-0-4, vfsUrl=my-ear-6-0-4.ear/webApp.war
      14:33:31,015 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/develop/server/jboss-5.0.0.GA.JDK6/server/standard/deploy/my-ear-6-0-4.ear/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.j2ee:service=EjbModule,module="my-ejbs.jar"
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:123)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
      at org.jboss.Main.boot(Main.java:209)
      at org.jboss.Main$1.run(Main.java:547)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.IllegalStateException: jboss.j2ee:module="my-ejbs.jar",service=EjbModule is already installed.
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:716)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
      at org.jboss.system.ServiceController.doInstall(ServiceController.java:670)
      at org.jboss.system.ServiceController.install(ServiceController.java:273)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:95)
      ... 24 more
      14:33:31,093 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

      *** CONTEXTS IN ERROR: Name -> Error

      vfsfile:/C:/develop/server/jboss-5.0.0.GA.JDK6/server/standard/deploy/my-ear-6-0-4.ear/ -> java.lang.IllegalStateException: jboss.j2ee:module="my-ejbs.jar",service=EjbModule is already installed.


      14:33:31,109 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      14:33:31,140 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      14:33:31,140 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812042120)] Started in 1m:40s:531ms

        • 1. Re: EjbModule is already installed JBossAS-5.0.0.GA
          jaikiran pai Master

          What does your application.xml look like?

          While posting logs or xml content or code please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure your post is correctly formatted.

          • 2. Re: EjbModule is already installed JBossAS-5.0.0.GA
            Henrik Lindell Newbie

            Hi!

            The problem occur when deploying my-ejbs.jar which is named the same

            application.xml in ear 1:

            <?xml version="1.0" encoding="UTF-8"?>
            <application xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
             http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
             version="1.4">
             <display-name>first</display-name>
             <module>
             <ejb>my-ejbs.jar</ejb>
             </module>
             <module>
             <ejb>first.jar</ejb>
             </module>
             <module>
             <web>
             <web-uri>webApp.war</web-uri>
             <context-root>first-6-0-4</context-root>
             </web>
             </module>
            </application>



            application.xml in ear 2:
            <?xml version="1.0" encoding="UTF-8"?>
            <application xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
             http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
             version="1.4">
             <display-name>yet-other</display-name>
             <module>
             <ejb>my-ejbs.jar</ejb>
             </module>
             <module>
             <ejb>yet-other.jar</ejb>
             </module>
             <module>
             <web>
             <web-uri>webApp.war</web-uri>
             <context-root>yet-other-6-0-7</context-root>
             </web>
             </module>
            </application>




            • 3. Re: EjbModule is already installed JBossAS-5.0.0.GA
              jaikiran pai Master

              Looks like a bug to me. You could open a JIRA issue here https://jira.jboss.org/jira/browse/JBAS. As a workaround, you can rename one of the jars to be unique.

              • 4. Re: EjbModule is already installed JBossAS-5.0.0.GA
                Henrik Lindell Newbie

                Yes! just what I did its here:
                https://jira.jboss.org/jira/browse/JBAS-6335

                Thanks for helping!

                If anyone can come up with another workaround it would be preferred because its just too much work for us in the build scripts and also backward compatibility issues with existing in-production versions of the EARs running on WLS.

                • 5. Re: EjbModule is already installed JBossAS-5.0.0.GA
                  sandip desale Newbie

                  I am installing a plain WAR file with a simple JSP for testing of my Cluster for session replication. I am having 2 JBoss AS nodes on same system i.e Verticle Clustering. But when i doing failover from node1 to node2, session is not get replicated. On Node1, session will be A and on node2 on failover mode session id changes.

                  I am also facing the following error while starting the JBoss AS Node.
                  Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperMBean

                  Please help for solving this.

                  • 6. Re: EjbModule is already installed JBossAS-5.0.0.GA
                    jaikiran pai Master

                     

                    "maildesale" wrote:
                    I am installing a plain WAR file with a simple JSP for testing of my Cluster for session replication. I am having 2 JBoss AS nodes on same system i.e Verticle Clustering. But when i doing failover from node1 to node2, session is not get replicated. On Node1, session will be A and on node2 on failover mode session id changes.

                    I am also facing the following error while starting the JBoss AS Node.
                    Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperMBean

                    Please help for solving this.


                    maildesale,

                    Please create a new thread (instead of posting in a thread with discusses a totally different issue), in this forum so that we can discuss this there :)


                    • 7. Re: EjbModule is already installed JBossAS-5.0.0.GA
                      Karl Traunmüller Newbie

                      Similar issue with persistence units - if two ears (say, test1.ear and test2.ear) include the same ejb jar (with same META-INF/persistence.xml), you get

                      19:51:46,959 WARN [AbstractDeploymentContext] Unable to register deployment mbean org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.TestEjb
                      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.TestEjb",type=Component already registered.
                       at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
                       at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
                       at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:597)
                       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                       at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
                       at java.security.AccessController.doPrivileged(Native Method)
                       at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
                       at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
                       at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
                       at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.addComponent(AbstractDeploymentContext.java:719)
                       at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.addComponent(AbstractDeploymentUnit.java:249)
                       at org.jboss.jpa.deployers.AbstractDeploymentVisitor.addComponent(AbstractDeploymentVisitor.java:49)
                       at org.jboss.jpa.deployers.AbstractDeploymentVisitor.deploy(AbstractDeploymentVisitor.java:64)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.internalDeploy(AbstractRealDeployerWithInput.java:102)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.internalDeploy(AbstractComponentDeployer.java:78)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                       at org.jboss.Main.boot(Main.java:209)
                       at org.jboss.Main$1.run(Main.java:547)
                       at java.lang.Thread.run(Thread.java:637)
                      
                      


                      application.xml (identical in test1.ear and test2.ear):
                      <application>
                       <display-name>Test Application</display-name>
                      
                       <module>
                       <ejb>TestEjb.jar</ejb>
                       </module>
                      
                      </application>
                      


                      persistence.xml (in TestEjb.jar's META-INF):
                      <?xml version="1.0" encoding="UTF-8"?>
                      <persistence version="1.0"
                       xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
                       <persistence-unit name="TestEjb">
                       <provider>org.hibernate.ejb.HibernatePersistence</provider>
                       <jta-data-source>java:/TestDatasource</jta-data-source>
                       <properties>
                       <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
                       </properties>
                       </persistence-unit>
                      </persistence>
                      


                      Although the JNDI View shows both persistence units:
                      +- persistence.unit:unitName=test2.ear (class: org.jnp.interfaces.NamingContext)
                       | +- TestEjb.jar#TestEjb (class: org.hibernate.impl.SessionFactoryImpl)
                      ...
                      +- persistence.unit:unitName=test1.ear (class: org.jnp.interfaces.NamingContext)
                       | +- TestEjb.jar#TestEjb (class: org.hibernate.impl.SessionFactoryImpl)
                      


                      regards,
                      Karl

                      • 8. Re: EjbModule is already installed JBossAS-5.0.0.GA
                        Andy Gumbrecht Newbie

                        Hi Karl,

                        "karltraunmueller" wrote:
                        Similar issue with persistence units - if two ears (say, test1.ear and test2.ear) include the same ejb jar (with same META-INF/persistence.xml), you get...


                        I have an identical issue. Did you file this as a bug, or did you find a resolution?

                        Thanks,

                        Andy.

                        • 9. Re: EjbModule is already installed JBossAS-5.0.0.GA
                          jaikiran pai Master

                           

                          19:51:46,959 WARN [AbstractDeploymentContext] Unable to register deployment mbean org.jboss.metadat
                          a.jpa.spec.PersistenceUnitMetaData.TestEjb
                          javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.TestEjb",type=Component already registered.
                          


                          https://jira.jboss.org/jira/browse/JBAS-6821