2 Replies Latest reply on May 10, 2002 8:46 AM by SM Muk

    EJBHome lookup failed, NamingException null error

    SM Muk Newbie

      Hi.

      I have successfully deployed my stateless session bean on JBoss and my application is trying to do a lookup.My JNDI is bound successfully but I the lookup returns a null value.

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost:1099");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      ctx = new InitialContext(env);
      EJBHome ejbHome = null;
      Object home = (EJBHome)ctx.lookup(lookup);
      ejbHome = (EJBHome) PortableRemoteObject.narrow(home, EJBHome.class);

      I've done some print line statements to check where it's going wrong and basically it's at the Object line where it does the lookup when it fails. The JNDI name is correct because lookup not bound did not appear in my logs. Instead I've got a Naming Exception is null value.

      Can someone help me?

      Thanks in advance.