tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Biolcati" <lbiolc...@odx.it>
Subject JNDI problem
Date Fri, 11 Jan 2002 13:57:46 GMT
Hello,
I'm a newbie wioth tomcat and JNDI, trying to use an eviroment variable with
Tomcat 4.0.1 in my web app. The following exception occurs when I try to
read it:

javax.naming.NameNotFoundException: Name java:comp is not bound in this
Context

this is the code that try to read that variable (following the example in
tomcat doc):

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

and here is how I've configured my web.xml:

===========================================
<env-entry>
  <env-entry-name>xsl-home</env-entry-name>

<env-entry-value>D:/Programmi/eclipse/workspace/webmodel/web/WEB-INF/xsl</en
v-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
 </env-entry>
===========================================

Do I need to initialize somehow the java:comp/env Context?
Thanks for any suggestion,
Luca


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message