3 Replies Latest reply on Jun 2, 2004 5:52 AM by Juha Lindfors

    Lookup inside EJB

    jmwong Newbie

      I have a problem looking up EJB homes from inside a different EJB. I'm using this code inside a servlet:

      Context initial = new InitialContext();
      Object objref = initial.lookup("java:comp/env/ejb/Sensor");
      sensorHome =
      (SensorHome) PortableRemoteObject.narrow(objref, SensorHome.class);
      


      It works fine, but using the same code inside an EJB fails with --javax.naming.NameNotFoundException: ejb not bound

      Any suggestions? Thanks.