title: Unable to resolve <JNDI>
body: <p>I have a SessionBean in JNDI bound under "ejb.Bb_restriction_USRemoteHome". This is confirmed by the Weblogic console too. </p>
  
  <p>But while accessing it through the following piece of code :</p>
  
  <pre><code>private static Context getInitialContext() throws NamingException {
        Context ctx = null;
        Hashtable ht = new Hashtable();
        ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
        ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
        ctx = new InitialContext(ht);
        return ctx;
  }
  
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      try {
          Context ctx = getInitialContext();
          System.out.println(ctx.list("java:comp/env"));
          System.out.println(ctx.lookup("ejb.Bb_restriction_USRemoteHome").getClass());
      } catch (NamingException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>, I was getting the following error:</p>
  
  <pre><code>javax.naming.NameNotFoundException: Unable to resolve 'ejb.Bb_restriction_USRemoteHome'. Resolved 'ejb'; remaining name 'Bb_restriction_USRemoteHome'
      at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
      at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
      at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
      at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
      at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
      at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
      at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at TestServlet.doGet(TestServlet.java:50)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
  </code></pre>
  
  <p>The output of "System.out.println(ctx.list("java:comp/env"));" is weblogic.jndi.internal.NameClassPairEnumeration@aee30f only.</p>
  
  <p>Can anybody please tell me how to retrieve the object with JNDI name "ejb.Bb_restriction_USRemoteHome"?</p>