1 Reply Latest reply on Aug 18, 2002 2:53 AM by David Jencks

    Local beans not getting deployed second time with different

    Jayakumar Newbie

      hi,

      I had a ejb-jar with a single local bean( i.e. a bean and local home and local interface). I deployed the bean first time with a local-jndi-name, say "A". It deployed successfully. I changed the local-jndi-name, say "B" and repackaged it in a different jar. When I trying to deply it, the below exception is thrown. Is this the excepted behaviour? or Where am I going wrong?
      Excepting the reply very soon.

      Here is my ejb-jar.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC
      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      Sample Application
      <display-name>Example EJB</display-name>
      <enterprise-beans>

      <ejb-name>Data</ejb-name>
      <local-home>beans.example.DataHome</local-home>
      beans.example.Data
      <ejb-class>beans.example.DataBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      false

      </enterprise-beans>
      </ejb-jar>

      I used this ejb-jar xml for both the deployment.

      Here is my jboss.xml for the first deployment:

      <?xml version="1.0" encoding="UTF-8"?>

      <enterprise-beans>

      <ejb-name>Data</ejb-name>
      <local-jndi-name>example/Data</local-jndi-name>

      </enterprise-beans>


      Here is my jboss.xml for the second deployment:

      <?xml version="1.0" encoding="UTF-8"?>

      <enterprise-beans>

      <ejb-name>Data</ejb-name>
      <local-jndi-name>example/Data11</local-jndi-name>

      </enterprise-beans>


      Here is the stack trace of the exception:

      10:33:40:261: [org.jboss.deployment.MainDeployer] Successfully completed deployment of package: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/conf/jboss-service.xml
      10:33:40:261: [org.jboss.system.server.Server] JBoss (MX MicroKernel) [3.0.0 Date:200205311035] Started in 0m:49s:321ms
      10:34:45:515: [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/example.jar
      10:34:45:755: [org.jboss.ejb.EjbModule] Creating
      10:34:45:795: [org.jboss.ejb.EjbModule] Deploying Data
      10:34:45:826: [org.jboss.ejb.EjbModule] Created
      10:34:45:826: [org.jboss.ejb.EjbModule] Starting
      10:34:45:836: [org.jboss.ejb.EjbModule] Started
      10:34:45:836: [org.jboss.deployment.MainDeployer] Successfully completed deployment of package: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/example.jar
      10:36:21:183: [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/example1.jar
      10:36:21:353: [org.jboss.ejb.EjbModule] Creating
      10:36:21:383: [org.jboss.ejb.EjbModule] Deploying Data
      10:36:21:433: [org.jboss.ejb.EjbModule] Remove JSR-77 EJB Module: jboss.management.single:J2EEApplication= ,J2EEServer=Single,j2eeType=EJBModule,name=example1.jar
      10:36:21:433: [org.jboss.ejb.EjbModule] Initialization failed
      javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EJB,jndiName=Data already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:654)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:240)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:949)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:276)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:389)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:894)
      at $Proxy6.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:272)
      at org.jboss.system.ServiceController.create(ServiceController.java:212)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:380)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:637)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:512)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:202)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      10:36:21:453: [org.jboss.deployment.MainDeployer] could not create deployment: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/example1.jar
      org.jboss.deployment.DeploymentException: error in create of EjbModule: file:/D:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/example1.jar; - nested throwable: (javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EJB,jndiName=Data already registered.)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:384)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:637)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:512)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:202)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EJB,jndiName=Data already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:654)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:240)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:949)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:276)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:389)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:894)
      at $Proxy6.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:272)
      at org.jboss.system.ServiceController.create(ServiceController.java:212)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:380)
      ... 15 more


      Thanks & Regards,
      Jayakumar