javax.naming.NoInitialContextException

Discussions

EJB design: javax.naming.NoInitialContextException

  1. javax.naming.NoInitialContextException (1 messages)

    Hi,

       I deployed my war file in weblogic 7.0. When my connection class is trying to get the connection from the pool using the JNDI InitialContext... I get the following error...

    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

    -- To get the InitialContext of JNDI with in weblogic the server, in which I'm running the code...I use the following code...
         InitialContext ic = new InitialContext();

    --To get the InitialContext of the external JNDI. I use the following code right..
     Hashtable env = new Hashtable(5);
             env.put(Context.INITIAL_CONTEXT_FACTORY,
                     "weblogic.jndi.WLInitialContextFactory");
             env.put(Context.PROVIDER_URL,
                     "t3://136.151.216.142:7001");
             Context ic = new InitialContext(env);
         
    In my case I'm using the first option...And i get the javax.naming.NoInitialContextException exception... DO i need update any configuration information in weblogic..

    Any help is appreciated..
    Muraki
  2. The above code looks correct to me. Is the problem in the external client? If so, maybe the client classpath is not set correctly.