2 Replies Latest reply on Mar 21, 2003 6:44 AM by petertje

    NameNotFoundException: ejb nt bound

    danbar

      I've got simple application which contains 1 web module and 1 ejb module. This app doesn't contain any provider specific descriptors. Deploying seems to be OK, but after running default JSP page (news.jsp), following code:

      InitialContext context = new InitialContext();
      Object o = context.lookup("java:comp/env/ejb/NewsManagerEJB");

      causes exception (see: subject).
      I've tried different jndi names like:

      java:comp/env/ejb/NewsManagerEJB
      ejb/NewsManagerEJB
      NewsManagerEJB

      with no success.

      Any ideas ?

      BTW. I've deployed and run it earlier on Macromedia JRun4 successfully.

        • 1. Re: NameNotFoundException: ejb nt bound
          danbar

          Here's attachment with entire app.

          • 2. Re: NameNotFoundException: ejb nt bound

            > context.lookup("java:comp/env/ejb/NewsManagerEJB");

            Lookup in the ENC (which is the naming context of the calling component, the servlet in your case), won't work because you didn't map any ejb-refs to the servlets ENC.

            However, lookup using the global name (ejb/NewsManagerEJB in your case) should always work. Check the jmx-console - JNDIView to see if the bean is correctly bound to that name.

            Hth
            Peter.