tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Burbidge <>
Subject Where to define Context element...
Date Tue, 29 Apr 2008 15:05:24 GMT
I'm trying to define a JNDI resource for a datasource. The Tomcat  
documentation lists several different places that you can define a  
Context element. I don't want to define it in my app's web.xml and I  
don't want to modify tomcat config files. I want to define a companion  
file for my app, but I'm having a hard time understanding the  
documentation. It says the following, is one place you can define a  
Context element:

in individual files (with a ".xml" extension) in the $CATALINA_HOME/ 
conf/[enginename]/[hostname]/ directory. The name of the file (less  
the .xml) extension will be used as the context path. Multi-level  
context paths may be defined using #, e.g.context#path.xml.

My web app is in a war called mytest.war, which I deployed to  
$CATALINA_HOME/webapps. My web.xml has the following elements:



I placed a file named mytest.xml in $CATALINA_HOME/conf/Catalina/ 
localhost/mytest.xml. mytest.xml contains the following:

<Context path="/mytest" docBase="mytest"
         debug="5" reloadable="true" crossContext="true">

   <Resource name="jdbc/mytest" auth="Container"  
                maxActive="100" maxIdle="30" maxWait="10000"
                username="javauser" password="javadude"  


My Context defined this way is not loaded. I've checked using the  
Tomcat Manager and there is no JNDI resource loaded. What am I doing  


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message