1 Reply Latest reply on May 26, 2015 12:36 PM by Verny Quartara

    [EAP6.3] Local JNDI lookup does not work

    Verny Quartara Newbie

      Hi everybody,

      I have deployed an EAR with two modules: ejb and web. The console says:

       

      INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] JNDI bindings for session bean named NavigazioneBDFacade in deployment unit subdeployment "visura-bke-ejb.jar" of deployment "visura-bke-ear.ear" are as follows:

       

          java:global/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD

         java:app/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD

          java:module/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD

          java:jboss/exported/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD

          java:global/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocal

          java:app/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocal

          java:module/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocal

          java:global/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocalHome

          java:app/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocalHome

          java:module/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.NavigazioneBDFacadeLocalHome

          java:global/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBDHome

          java:app/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBDHome

          java:module/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBDHome

          java:jboss/exported/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBDHome

       

      I'm trying to lookup a stateful session EJB 2.1 from the web module, by doing:

       

      NavigazioneBDFacadeLocal navigazioneBDFacadeLocal = (NavigazioneBDFacadeLocal) new InitialContext().lookup ("java:app/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD");


      This way I always get a "NameNotFoundException".

       

      Instead, if I use java:global/visura-bke-ear/visura-bke-ejb/NavigazioneBDFacade!it.visura.bke.business.navigazione.ejb.facade.INavigazioneBD

      The lookup works properly.

      Can someone explain why?

      The class from within I'm doing the lookup is a Quartz Job (eg. a pojo)

       

      Thanks