2 Replies Latest reply on Jun 28, 2010 8:41 AM by Karstem Strunk

    Problem with @LocalBinding and @RemoteBinding in JBoss 5.0.0

    Karstem Strunk Newbie

      Hi,

       

      I'm working with EJB3 and JBoss 5.0.0. My problem is that I cannot get jndiBinding in @LocalBinding and @RemoteBinding to work properly with two classes with the same name, but different package, e.g.

       

           package1.ClassName

           package2.ClassName

       

      Here's an example of my class definition:

       

      @Stateless
      @Local(package1.ClassNameLocal.class)
      @Remote(package1.ClassNameRemote.class)
      @LocalBinding(jndiBinding = "earFile/package1/ClassName/local")
      @RemoteBinding(jndiBinding = "earFile/package1/ClassName/remote")
      public class package1.ClassName implements package1.ClassNameLocal, package1.ClassNameRemote

       

      @Stateless
      @Local(package2.ClassNameLocal.class)
      @Remote(package2.ClassNameRemote.class)
      @LocalBinding(jndiBinding = "earFile/package2/ClassName/local")
      @RemoteBinding(jndiBinding = "earFile/package2/ClassName/remote")
      public class package2.ClassName implements package2.ClassNameLocal,  package2.ClassNameRemote

       

      I'd expect the following bindings:

       

      earFile/package1/ClassName/local

      earFile/package1/ClassName/remote

       

      earFile/package2/ClassName/local

      earFile/package2/ClassName/remote

       

      But I get the following error messages:

       

      17:28:19,203 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/G:/jboss-5.1.0.GA/server/default/deploy/earFile.ear/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying Ejb.jar: Error creating ejb container ClassName: Container jboss.j2ee:ear=earFile.ear,jar=Ejb.jar,name=ClassName,service=EJB3,VMID=31fd4e232b997e33:-363f4e1f:1296fb0bd8e:-7fab + is already registered
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
          at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
          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:1631)
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
          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:702)
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
          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: org.jboss.deployers.spi.DeploymentException: Error creating ejb container ClassName: Container jboss.j2ee:ear=earFile.ear,jar=Ejb.jar,name=ClassName,service=EJB3,VMID=31fd4e232b997e33:-363f4e1f:1296fb0bd8e:-7fab + is already registered
          at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:748)
          at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:685)
          at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:667)
          at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:630)
          at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:507)
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:182)
          ... 29 more
      Caused by: java.lang.IllegalStateException: Container jboss.j2ee:ear=earFile.ear,jar=Ejb.jar,name=ClassName,service=EJB3,VMID=31fd4e232b997e33:-363f4e1f:1296fb0bd8e:-7fab + is already registered
          at org.jboss.ejb3.Ejb3Registry.register(Ejb3Registry.java:128)
          at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:744)
          ... 34 more
      17:28:19,203 WARN  [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      *** DEPLOYMENTS IN ERROR: Name -> Error

       

      vfsfile:/G:/jboss-5.1.0.GA/server/default/deploy/earFile.ear/ -> org.jboss.deployers.spi.DeploymentException: Error deploying Ejb.jar: Error creating ejb container ClassName: Container jboss.j2ee:ear=earFile.ear,jar=Ejb.jar,name=ClassName,service=EJB3,VMID=31fd4e232b997e33:-363f4e1f:1296fb0bd8e:-7fab + is already registered

       


      DEPLOYMENTS IN ERROR:
        Deployment "vfsfile:/G:/jboss-5.1.0.GA/server/default/deploy/earFile.ear/" is in error due to the following reason(s): java.lang.IllegalStateException: Container jboss.j2ee:ear=earFile.ear,jar=Ejb.jar,name=ClassName,service=EJB3,VMID=31fd4e232b997e33:-363f4e1f:1296fb0bd8e:-7fab + is already registered

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
          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)

       

      Can anybody help me to define the bindings?