Baljinder Singh
Baljinder Singh

Reputation: 11

javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory

In eclipse same code is working fine when executed as simple java program. But when same is called through Dynamic Web project it is throwing exception "javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]"

wlfullclient.jar is also attached to dynamic web project kept in WebContent\WEB-INF\lib folder.

Code is as follows. Thanks in advance

Hashtable env = new Hashtable();
     env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
     env.put(Context.PROVIDER_URL, url);
     return new InitialContext(env);

Upvotes: 0

Views: 4405

Answers (1)

Baljinder Singh
Baljinder Singh

Reputation: 11

It seems Tomcat dynamic Web project one should use 'wlthint3client.jar' instead of 'wlfullclient.jar'. I copied the 'wlthint3client.jar' in lib folder and project was working fine after that.

Upvotes: 1

Related Questions