3 Replies Latest reply on Mar 21, 2006 12:34 PM by Harri Tuomela

    How to bind only to a "local" JNDI

    Warg Krumpf Newbie

      Is there a way to bind (SessionBeans) only to a ear-scoped part of the JNDI, so i could deploy my application multiple times without getting javax.management.InstanceAlreadyExistsException

      These beans need to be accessible only from within the .ear they are contained in (i.e.. local interfaces), so there shouldnt be any JNDi name clashes.

      (The only annotation i have right now is "@Stateless", so beans are bound by their FQ classname. )

      Would it help to somehow supress generation of Remote interfaces, any if so, how to do it?


        • 1. Re: How to bind only to a
          Warg Krumpf Newbie

          I did some tests and also had a closer look at the JNDI tree.

          So the first problem is that the classname of the SessionBean itself is registered in the global JNDI as a org.jboss.ejb3.stateless.StatelessContainer.

          When i try to deploy a second copy of this application (just with different settings in persistence.xml) the deployment fails with

          javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EJB3,name=de.eyetea.smartea.daosession.CommonDAOBean already registered.

          Is there a way to stop JBoss from doing this, or maybe specify a prefix in jboss.xml???

          Then the next question would be how to register the LocalHomes in the "java:enc" jndi subtree, so that there will no clashes again.

          Any thoughts on this?

          • 2. while deployig the application i got an error
            dhanaraj raj Newbie

            10:26:41,843 INFO [StatelessManager] Registration is not done -> stop
            10:26:41,843 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=simple.jar
            javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EJB3,name=ejb/Test already registered.

            if you find a solution mail me at dhanarajk@kgisliim.com

            • 3. Re: How to bind only to a
              Harri Tuomela Newbie

              The problem is already discussed in another topic. See also the issue EJBTHREE-352 in JIRA.