3 Replies Latest reply on Apr 24, 2009 4:48 AM by johnstok -

    Why are my EJBs mounted in JNDI twice?

    johnstok - Newbie

      When I deploy my application to jBoss it seems to work ok. However, looking into JNDI using the JndiView mBean I see that my EJBs appear to be deployed twice. Once at the JNDI root and again within the context of the ear.

      Any ideas? Is this normal?

       +- UserTransactionSessionFactory (proxy: $Proxy137 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
       +- PublicCommands (class: org.jnp.interfaces.NamingContext)
       | +- remote-ccc.services.api.Commands (class: Proxy for: ccc.services.api.Commands)
       | +- remote (class: Proxy for: ccc.services.api.Commands)
       +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
       +- DataManager (class: org.jnp.interfaces.NamingContext)
       | +- local (class: Proxy for: ccc.services.DataManager)
       | +- local-ccc.services.DataManager (class: Proxy for: ccc.services.DataManager)
       +- persistence.unit:unitName=application-ear-default.ear (class: org.jnp.interfaces.NamingContext)
       | +- lib (class: org.jnp.interfaces.NamingContext)
       | | +- core-domain-7.0.0-SNAPSHOT.jar#ccc-persistence (class: org.hibernate.impl.SessionFactoryImpl)
       +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
       +- ActionExecutor (class: org.jnp.interfaces.NamingContext)
       | +- local-ccc.services.ActionExecutor (class: Proxy for: ccc.services.ActionExecutor)
       | +- local (class: Proxy for: ccc.services.ActionExecutor)
       +- AliasDao (class: org.jnp.interfaces.NamingContext)
       | +- local-ccc.services.AliasDao (class: Proxy for: ccc.services.AliasDao)
       | +- local (class: Proxy for: ccc.services.AliasDao)
       +- PageDao (class: org.jnp.interfaces.NamingContext)
       | +- local-ccc.services.PageDao (class: Proxy for: ccc.services.PageDao)
       | +- local (class: Proxy for: ccc.services.PageDao)
       +- XAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- topic (class: org.jnp.interfaces.NamingContext)
       +- TemplateDao (class: org.jnp.interfaces.NamingContext)
       | +- local (class: Proxy for: ccc.services.TemplateDao)
       | +- local-ccc.services.TemplateDao (class: Proxy for: ccc.services.TemplateDao)
       +- ClusteredConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- queue (class: org.jnp.interfaces.NamingContext)
       | +- DLQ (class: org.jboss.jms.destination.JBossQueue)
       | +- ExpiryQueue (class: org.jboss.jms.destination.JBossQueue)
       +- ClusteredXAConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
       +- invokers (class: org.jnp.interfaces.NamingContext)
       | +- kreios (class: org.jnp.interfaces.NamingContext)
       | | +- iiop (class: org.jboss.invocation.iiop.IIOPInvoker)
       +- ConnectionFactory (class: org.jboss.jms.client.JBossConnectionFactory)
       +- jmx (class: org.jnp.interfaces.NamingContext)
       | +- invoker (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor (proxy: $Proxy135 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
       | +- rmi (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
       +- Search (class: org.jnp.interfaces.NamingContext)
       | +- remote-ccc.services.Scheduler (class: Proxy for: ccc.services.Scheduler)
       | +- local (class: Proxy for: ccc.services.SearchEngine)
       | +- remote (class: Proxy for: ccc.services.Scheduler)
       | +- local-ccc.services.SearchEngine (class: Proxy for: ccc.services.SearchEngine)
       +- JAXR (class: org.apache.ws.scout.registry.ConnectionFactoryImpl)
       +- application-ear-default (class: org.jnp.interfaces.NamingContext)
       | +- PublicCommands (class: org.jnp.interfaces.NamingContext)
       | | +- remote-ccc.services.api.Commands (class: Proxy for: ccc.services.api.Commands)
       | | +- remote (class: Proxy for: ccc.services.api.Commands)
       | +- DataManager (class: org.jnp.interfaces.NamingContext)
       | | +- local (class: Proxy for: ccc.services.DataManager)
       | | +- local-ccc.services.DataManager (class: Proxy for: ccc.services.DataManager)
       | +- ActionExecutor (class: org.jnp.interfaces.NamingContext)
       | | +- local-ccc.services.ActionExecutor (class: Proxy for: ccc.services.ActionExecutor)
       | | +- local (class: Proxy for: ccc.services.ActionExecutor)
       | +- AliasDao (class: org.jnp.interfaces.NamingContext)
       | | +- local-ccc.services.AliasDao (class: Proxy for: ccc.services.AliasDao)
       | | +- local (class: Proxy for: ccc.services.AliasDao)
       | +- PageDao (class: org.jnp.interfaces.NamingContext)
       | | +- local-ccc.services.PageDao (class: Proxy for: ccc.services.PageDao)
       | | +- local (class: Proxy for: ccc.services.PageDao)
       | +- TemplateDao (class: org.jnp.interfaces.NamingContext)
       | | +- local (class: Proxy for: ccc.services.TemplateDao)
       | | +- local-ccc.services.TemplateDao (class: Proxy for: ccc.services.TemplateDao)
       | +- Search (class: org.jnp.interfaces.NamingContext)
       | | +- remote-ccc.services.Scheduler (class: Proxy for: ccc.services.Scheduler)
       | | +- local (class: Proxy for: ccc.services.SearchEngine)
       | | +- remote (class: Proxy for: ccc.services.Scheduler)
       | | +- local-ccc.services.SearchEngine (class: Proxy for: ccc.services.SearchEngine)
       | +- UserManager (class: org.jnp.interfaces.NamingContext)
       | | +- local (class: Proxy for: ccc.services.UserManager)
       | | +- local-ccc.services.UserManager (class: Proxy for: ccc.services.UserManager)
       | +- PublicQueries (class: org.jnp.interfaces.NamingContext)
       | | +- remote (class: Proxy for: ccc.services.api.Queries)
       | | +- remote-ccc.services.api.Queries (class: Proxy for: ccc.services.api.Queries)
       | +- FolderDao (class: org.jnp.interfaces.NamingContext)
       | | +- local-ccc.services.FolderDao (class: Proxy for: ccc.services.FolderDao)
       | | +- local (class: Proxy for: ccc.services.FolderDao)
       | +- ActionDao (class: org.jnp.interfaces.NamingContext)
       | | +- local-ccc.services.ActionDao (class: Proxy for: ccc.services.ActionDao)
       | | +- remote-ccc.services.Scheduler (class: Proxy for: ccc.services.Scheduler)
       | | +- local (class: Proxy for: ccc.services.ActionDao)
       | | +- remote (class: Proxy for: ccc.services.Scheduler)
       +- TomcatAuthenticators (class: java.util.Properties)
       +- UserManager (class: org.jnp.interfaces.NamingContext)
       | +- local (class: Proxy for: ccc.services.UserManager)
       | +- local-ccc.services.UserManager (class: Proxy for: ccc.services.UserManager)
       +- PublicQueries (class: org.jnp.interfaces.NamingContext)
       | +- remote (class: Proxy for: ccc.services.api.Queries)
       | +- remote-ccc.services.api.Queries (class: Proxy for: ccc.services.api.Queries)
       +- FolderDao (class: org.jnp.interfaces.NamingContext)
       | +- local-ccc.services.FolderDao (class: Proxy for: ccc.services.FolderDao)
       | +- local (class: Proxy for: ccc.services.FolderDao)
       +- ActionDao (class: org.jnp.interfaces.NamingContext)
       | +- local-ccc.services.ActionDao (class: Proxy for: ccc.services.ActionDao)
       | +- remote-ccc.services.Scheduler (class: Proxy for: ccc.services.Scheduler)
       | +- local (class: Proxy for: ccc.services.ActionDao)
       | +- remote (class: Proxy for: ccc.services.Scheduler)
      


        • 1. Re: Why are my EJBs mounted in JNDI twice?
          jaikiran pai Master

          Not normal. Are there 2 separate applications being deployed at the same time with these EJBs?

          • 2. Re: Why are my EJBs mounted in JNDI twice?
            jaikiran pai Master

            Looking at your post in other thread:

            12:32:48,087 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=application-ear-default.ear,jar=services-ejb3-7.0.0-SNAPSHOT.jar,name=Search,service=EJB3
            
            ...
            12:32:48,165 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
            
             application-ear-default/PageDao/local - EJB3.x Default Local Business Interface
             application-ear-default/PageDao/local-ccc.services.PageDao - EJB3.x Local Business Interface
            ...
            
            12:32:48,696 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=application-ear-default.ear,jar=application-ear-default.ear,name=Search,service=EJB3
            
            ...
            12:32:48,727 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
            
             PageDao/local - EJB3.x Default Local Business Interface
             PageDao/local-ccc.services.PageDao - EJB3.x Local Business Interface
            


            Are you (by mistake), packaging an EAR within an EAR? application-ear-default.ear within application-ear-default.ear

            • 3. Re: Why are my EJBs mounted in JNDI twice?
              johnstok - Newbie

              jaikiran,

              Just had a look and I discovered I'm bundling the ejb jar at the root of the EAR and in the EAR's lib folder. Will fix that and let you know how it turns out.