3 Replies Latest reply on May 18, 2009 12:36 AM by jaikiran

    @Clustered + @RemoteBinding(jndiBinding => org.jboss.ejb3.co

      I got problem when deploy some ejb in clustered environemnt:
      JBoss 5.1.0.CR1 (same in 5.0.0.GA), JDK 1.6

      I deploy ejb 3.0 stateless bean (ejb jar included in ear file):

      @Clustered(partition= "DefaultPartition")
      @Remote
      @RemoteBinding(jndiBinding="prj/ServerCmdExecutor/remote")
      public class ServerCmdExecutorBean implements CmdExecutor {
      ...


      and gets error:

      java.lang.RuntimeException: org.jboss.ejb3.common.registrar.spi.DuplicateBindException: Could not register org.jboss.ejb3.proxy.clustered.factory.sess
      ion.stateless.StatelessSessionClusteredProxyFactory@565388 under an already registered key, "ProxyFactory/prototype_ear-0.1-SNAPSHOT/ServerCmdExecutor
      Bean/prj/ServerCmdExecutor/remote/DefaultPartition" for EJB ServerCmdExecutorBean
      at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.createJndiReferenceBindingSet(JndiSessionRegistrarBase.java:245)
      at org.jboss.ejb3.proxy.clustered.jndiregistrar.JndiClusteredSessionRegistrarBase.createJndiReferenceBindingSet(JndiClusteredSessionRegistrarB
      ase.java:213)
      at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:148)
      at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:208)
      at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:522)
      at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:186)
      at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
      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:597)



      If I remove @RemoteBinding then it works but I get default name mapping which is ear name related (and is not good for me).
      It also work if this ejb is not clustered. What can be wrong, am I missing something or there can be some bug?

        • 1. Re: @Clustered + @RemoteBinding(jndiBinding => org.jboss.ejb

          summary deployment error related to what I described before:

          DEPLOYMENTS IN ERROR:
          Deployment "jboss.j2ee:ear=prototype_ear-0.1-SNAPSHOT.ear,jar=prototype_server_communication_ejb-0.1-SNAPSHOT.jar,name=ServerCmdExecutorBean,service
          =EJB3" is in error due to the following reason(s): org.jboss.ejb3.common.registrar.spi.DuplicateBindException: Cannot install org.jboss.ejb3.proxy.clu
          stered.factory.session.stateless.StatelessSessionClusteredProxyFactory@565388 under name "ProxyFactory/prototype_ear-0.1-SNAPSHOT/ServerCmdExecutorBea
          n/prj/ServerCmdExecutor/remote/DefaultPartition" as there is already an existing object there: org.jboss.ejb3.proxy.clustered.factory.session.
          stateless.StatelessSessionClusteredProxyFactory@1381d19



          And of course there are no two jars or ears with the same ejb deployed in jboss. This only happens when I use both annotation: @Clustered and @RemoteBinding.

          • 2. Re: @Clustered + @RemoteBinding(jndiBinding => org.jboss.ejb

            Unfortunatelly it was my mistake. I was pretty sure there is no second ejb component deployed. And it was almost true, but I missed that maven plugin put the same jar under ear/lib folder, so even if the second jar was not listed in application.xml as ejb module, it was somehow took by jboss deployer. After fixing this seems it works.

            • 3. Re: @Clustered + @RemoteBinding(jndiBinding => org.jboss.ejb
              jaikiran

               

              And it was almost true, but I missed that maven plugin put the same jar under ear/lib folder, so even if the second jar was not listed in application.xml as ejb module, it was somehow took by jboss deployer.

              Just a FYI - The EAR/lib folder is not expected to be scanned for deployments. There's a separate thread tracking this issue http://www.jboss.org/index.html?module=bb&op=viewtopic&t=143590