my dog learned polymorphism*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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