tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: How to read JNDI resources?
Date Wed, 06 Apr 2005 15:16:28 GMT
You need to include a <ResourceLink> element in your context.

Mark

Andrew Watters wrote:
> Using tomcat 4.3.1 I have included the following in server.xml
> <GlobalNamingResources>
>    <Environment name="config_file" type="java.lang.String" value="test"/>
>  </GlobalNamingResources>
> 
> 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?
> 
> Thanks
> Andrew
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message