5 Replies Latest reply on May 9, 2008 7:08 AM by jaikiran pai

    Trying to install already registered beans

    Rahul Soni Newbie

      Hi ,All

      I got the error that Trying to install already registered beans when I am deploying two Ears both Ear containts the same ejbs but have a different servlets and jsps in their war directory but the EJBs they are using are same. I have specify the two entries in the mssql-ds.xml for the two ears and datasources but the both ears using the same database say Northwind. First ear is deployed successfully but when jboss try to installl the second ear it will give the above error that ejbs are allready registered.

      wht to do in this case? I have never deployed the two Ear on the same jboss application server.

      Any help will be greatly appericiated.

      My Environment :- JBoss 4.0.5 GA
      jdk 1.5.0_06
      windows 2003 server
      SQL server 2005 9.00.1399

      Thanks,
      Rahul Soni




        • 1. Re: Trying to install already registered beans
          jaikiran pai Master

          Post the entire exception stacktrace. While posting the logs, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted.

          • 2. Re: Trying to install already registered beans
            Rahul Soni Newbie

            Hi ,Jaikiran here I have attached the stacktrace as you have guide me
            Thanks for your reply.

            Best Regards,
            Rahul Soni.

            
            [exec] javax.management.InstanceAlreadyExistsException: jboss.j2ee:jndiName=com.alerts.AlertsEntityEJBHome,service=EJB already registered.
             [exec] at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:761)
             [exec] at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:225)
             [exec] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422)
             [exec] at java.security.AccessController.doPrivileged(Native Method)
             [exec] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417)
             [exec] at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
             [exec] at org.jboss.ejb.EjbModule.createService(EjbModule.java:373)
             [exec] at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
             [exec] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
             [exec] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
             [exec] at $Proxy0.create(Unknown Source)
             [exec] at org.jboss.system.ServiceController.create(ServiceController.java:330)
             [exec] at org.jboss.system.ServiceController.create(ServiceController.java:273)
             [exec] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             [exec] at $Proxy25.create(Unknown Source)
             [exec] at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:641)
             [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             [exec] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
             [exec] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
             [exec] at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:74)
             [exec] at org.jboss.ws.integration.jboss.DeployerInterceptorEJB.create(DeployerInterceptorEJB.java:44)
             [exec] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
             [exec] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             [exec] at $Proxy26.create(Unknown Source)
             [exec] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
             [exec] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
             [exec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
             [exec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             [exec] at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             [exec] at $Proxy8.deploy(Unknown Source)
             [exec] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
             [exec] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
             [exec] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
             [exec] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
             [exec] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
             [exec] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
             [exec] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
             [exec] at $Proxy0.start(Unknown Source)
             [exec] at org.jboss.system.ServiceController.start(ServiceController.java:417)
             [exec] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             [exec] at $Proxy4.start(Unknown Source)
             [exec] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
             [exec] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             [exec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             [exec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             [exec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
             [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             [exec] at java.lang.reflect.Method.invoke(Method.java:585)
             [exec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             [exec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             [exec] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             [exec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             [exec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             [exec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             [exec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             [exec] at $Proxy5.deploy(Unknown Source)
             [exec] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
             [exec] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
             [exec] at org.jboss.Main.boot(Main.java:200)
             [exec] at org.jboss.Main$1.run(Main.java:490)
             [exec] at java.lang.Thread.run(Thread.java:595)
            


            • 3. Re: Trying to install already registered beans
              jaikiran pai Master

              You probably are specifying the same JNDI name for the EJBs in both the EARs. You will have to specify unique JNDI names for these EJBs in these 2 EARs.

              • 4. Re: Trying to install already registered beans
                Rahul Soni Newbie

                Thanks Jaikiran for your reply again
                but in the mssql-ds.xml I have specified the different jndi name for both the Ears. My mssql-ds.xml looks like this:-

                Best Regards,
                Rahul Soni.

                 <?xml version="1.0" encoding="UTF-8"?>
                 <datasources>
                 <local-tx-datasource>
                 <jndi-name>jdbc/Northwind1</jndi-name>
                 <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=Northwind;</connection-url>
                 <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                 <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                 <user-name>xx</user-name>
                 <password>xxxx</password>
                 <min-pool-size>3</min-pool-size>
                 <max-pool-size>200</max-pool-size>
                 <prepared-statement-cache-size>50</prepared-statement-cache-size>
                 </local-tx-datasource>
                 <local-tx-datasource>
                 <jndi-name>jdbc/Northwind2</jndi-name>
                 <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=Northwind;</connection-url>
                 <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                 <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                 <user-name>xx</user-name>
                 <password>xxxx</password>
                 <min-pool-size>3</min-pool-size>
                 <max-pool-size>200</max-pool-size>
                 <prepared-statement-cache-size>50</prepared-statement-cache-size>
                 </local-tx-datasource>
                </datasources>
                
                


                • 5. Re: Trying to install already registered beans
                  jaikiran pai Master

                  The -ds.xml specifies the JNDI name for the datasources and not the EJBs. The jndi-name for EJBs is specified in the jboss.xml file which will be in the META-INF folder of the ejb jar. If you don't have a jboss.xml file then JBoss uses the classname of the beans and bind the EJBs to that name. You will have to configure the jndi-name through jboss.xml to ensure that they are unique for the beans within these 2 EARs.