1 Reply Latest reply on Jul 21, 2009 1:27 AM by Michael Davis

    problem with local interface lookup

    nidhi dhamija Newbie

      Hi All
      I am calling a stateful session bean from my action servlet. when i tried to lookup the bean with remote interface .It is working fine .But when i try to lookup with local interface .It is giving me exception Ejb not bound. I

      try {
      
       javax.naming.InitialContext initialContext = new javax.naming.InitialContext();
       tr.TrLocalHome home =(TrLocalHome)initialContext.lookup("java:comp/env/ejb/TrLocalHome");
       trNew = home.create();
       } catch (NamingException e1) {
       e1.printStackTrace();
       } catch (CreateException e1) {
       e1.printStackTrace();
       }
      
      


      Above is my code .I am using both web part and ejb part in same project .Please tell me where i am getting wrong .Thanx in advance

        • 1. Re: problem with local interface lookup
          Michael Davis Newbie

          Hey,
          What application server are you using? I've read that some application servers load their EJB module with a different class loader than the one used to load the WEB module, which might account for why this is failing. I personally use JBoss which I know for a fact will let you use local interfaces in the WEB module that refference the EJB module.

          You also might want to make sure you are using the right JNDI name. Most application servers, when the load the EJB, also print out into the logs what the correct local and remote JNDI names are for the bean.



          Sorry I couldn't be of more helpful.

          Mike