File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

tomcat JNDI bug????

asirob civokviz
Greenhorn

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:

<env-entry>
<env-entry-name>uri</env-entry-name>
<env-entry-value>jdbc:mysql://localhost:3306/webadmin</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>

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?

thnx
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat JNDI bug????