tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Watters <>
Subject How to read JNDI resources?
Date Wed, 06 Apr 2005 14:37:14 GMT
Using tomcat 4.3.1 I have included the following in server.xml
    <Environment name="config_file" type="java.lang.String" value="test"/>

In a servlet loaded on startup I try to read in the property
InitialContext ic = new InitialContext();
Context ctx = (Context) ic.lookup("java:comp/env");
String configFilename = (String)(ctx.lookup("config_file"));

This code throws a NamingException. Where have I gone wrong?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message