It's not a secret anymore!*
The moose likes BEA/Weblogic and the fly likes InitialContext.lookup( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "InitialContext.lookup(""java:comp/env") throws NameNotFoundException" Watch "InitialContext.lookup(""java:comp/env") throws NameNotFoundException" New topic
Author

InitialContext.lookup(""java:comp/env") throws NameNotFoundException

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
in my application, I add ojdbc6.jar, wlfullclient-10-3.jar.
and in weblogic administration console > services > datasource, I define a Datasource with name
jdbc/abc

and then in the application, I access it using


this code run successfully without any error.

But if I try



Error:javax.naming.NameNotFoundException: remaining name: env

why would this happen (it can read the Datasource jndi but not java:comp/env)?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InitialContext.lookup(""java:comp/env") throws NameNotFoundException
 
Similar Threads
Need help urgent
InitialContext.lookup(""java:comp/env") throws NameNotFoundException
cannot lookup jndi if using following method
Creating a Datasource
Error creating Initial Context