1 Reply Latest reply on May 15, 2004 12:22 AM by Juha Lindfors

    Problems resolving Context.

    null null Newbie

      I~m trying to make a FiboConsole application, but when de debug reaches the context lookup, I get an excepion.
      Here´s the code:
      public static void main(String[] args) {
      FiboConsole fiboCon = new FiboConsole();
      try {
      Context context = new InitialContext();

      Object ref = context.lookup("java:/comp/env/ejb/Fibo");

      fiboCon.home = (FiboHome) PortableRemoteObject.narrow(ref, FiboHome.class);

      } catch (Exception e) {
      System.out.println("Lookup of java:/comp/env/ failed");
      }


      ----------------//---------

      Why my servlet ComputeServlet works fine and my console app not? Jus gimme the error:
      Lookup of java:/comp/env/ failed

      -------//------------------

      Sorry, but i´m a beginner....

        • 1. Re: Problems resolving Context.
          Juha Lindfors Master

          java:comp/env is the bean's private name space, a client cannot look up from that location. You need to access the global namespace (maybe Fibo?).

          Go to the jmx-console, find service=JNDIView, click "invoke" on the list operation and scroll down until you see "Global namespace" and find your bean proxy name there.