3 Replies Latest reply on Jul 8, 2010 5:06 AM by jaikiran pai

    Weld - Error with multiple EARs containing same EJB

    Greg Peterson Newbie

      Hi,

       

      I'm getting an error when trying to deploy two applications containing the same EJB component (eg for side by side deployment of same application with different configurations).  The first app deploys correctly, but the second one receives the following error:

       

      17:23:05,253 ERROR [AbstractKernelController] Error installing to Real: name=vfs:///C:/dev/jboss-6.0.0.M3/server/default/deploy/hello.ear state=PreReal mode=Man

      ual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error deploying: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.HelloBean_CompJnd
      iBinder
              at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:185)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58)
              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1596)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1628)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081)
              at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409)
              at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.IllegalStateException: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.HelloBean_CompJndiBinder is already installed.
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:833)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180)
              ... 32 more

       

      It looks as if the Weld deployer is generating a name for a component based on the EJB name, but this name is not unique within the server.  Since you can deploy 'regular' EE apps side by side, it seems reasonable that you should also be able to deploy Weld/CDI apps in the same way.

       

      This was against Weld Beta11 on JBoss AS 6.0.0.M3.