File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes tomcat JNDI bug???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat JNDI bug????" Watch "tomcat JNDI bug????" New topic

tomcat JNDI bug????

asirob civokviz

Joined: Jun 12, 2004
Posts: 24
hi everyone...

i use JNDI to read some configuration variables... but problem is
that sometimes it works but sometimes it does not (without reconfiguring
tomcat in between). I use 5.5.7 on java 1.5.0_02 (and I tried this on
Windows and Linux).

Here is definition in application's web.xml file:


I try to read it with:

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
uri = (String)envCtx.lookup("uri");

sometimes it is ok... but sometimes I got next message:

Name java:comp is not bound in this Context

I do not know if this is some misconfiguration or what?
any ideas?

I agree. Here's the link:
subject: tomcat JNDI bug????
It's not a secret anymore!