This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 245
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: InitialContext.lookup(""java:comp/env") throws NameNotFoundException
 
It's not a secret anymore!