9 Replies Latest reply on Apr 24, 2013 11:13 AM by cchantep

    JNDI (EJB) lookup

    Newbie

      Hi,

       

      I'm trying to migrate an app from JBoss 5.1.0.GA to JBoss 7.1.1.Final. I need to update a service locator class which is JNDI lookup (InitialContext.lookup) to locate session bean. Deployment is done with EAR containing ejb module (myEjbModule after there) and war. In console, I do see session beans deployed (bound?):

       

      java:global/myApp/myEjbModule/my.package.ContentServices!view.ContentServices
      java:app/myEjbModule/my.package.ContentServices!view.ContentServices
      java:module/my.package.ContentServices!view.ContentServices
      java:jboss/exported/myApp/myEjbModule/my.package.ContentServices!view.ContentServices
      java:global/myApp/myEjbModule/my.package.ContentServices
      java:app/myEjbModule/my.package.ContentServices
      java:module/my.package.ContentServices

       

      myApp being the application name defined in application.xml of .ear file.

       

      But when webapp class try to get session bean throught the locator, I got lookup failure. I've tried lot of naming combination (java:global/..., java:app/..., java:module/..., ejb:/global/..., …).

       

      I see forum topic about accessing EJB through lookup from remote client, but that's unclear to me how to successfully do that within same container/same app, as long as I would really prefer a compatibility solution rather than large refactoring.

       

      Session bean implementation is annotated like following:

       

      @javax.ejb.Stateless(name = "my.package.ContentServices")
      @javax.ejb.Remote({view.ContentServices.class})
      @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)

       

      Any help would be welcomed, thanks in advance.