Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

lookup problem- "java:comp/env"

843841Jan 23 2004 — edited Jan 23 2004
Hi ,

I have deployed my web application on OC4J server , containing a test.jsp page and the required WEB-INF directory.Now if I do a look up of
an ENV-ENTRY defined in web.xml,in test.jsp,the same throws an exception.The code is:

//=========================
//Code(test.jsp):

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:comp/env");

//it fails before the line below is exeuted.
String temp = (String) envContext.lookup("xyz/pqrs");
//===========================

This works perfectly in Tomcat but fails in OC4J environment.
I am wondering if this could be container dependent feature.

Any suggestions will be greatly appreciated.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2004
Added on Jan 23 2004
1 comment
317 views