Namin context
1 posts in topic
Flat View  Flat View

Posted By:   Rajesh_Chauhan
Posted On:   Tuesday, April 18, 2006 08:13 AM

javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at sbmEx.main(sbmEx.java:12)

Re: Namin context

Posted By:   WarnerJan_Veldhuis  
Posted On:   Tuesday, April 18, 2006 09:58 AM

Pasting a stacktrace is not really the way to get an answer to whatever problem you may have.... Just ask a question and get it over with...

You might want to create an environment (java.util.Hashtable) before accessing the JNDI:

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, the factory that your appserver requires);
env.put(Context.PROVIDER_URL, the url where to find the JNDI);
Initial contextRemote = new InitialContext(env);

About | Sitemap | Contact