A Techno Blog, mainly about Java

Tomcat 5 contexts definition

In Tomcat 5 , you can define your JNDI  connections in context.xml  and place the file in the /META-INF directory. Alternatively, you can name your context whatever you want by placing your project folder in the webapps directory, and placing a corresponding xml file in \conf\Catalina directory.

For example, I place myfirstapp folder in webapps directory and create myfirstapp.xml inside C:\java\javatools\jakarta-tomcat-5.5.7\conf\Catalina\

The xml file looks as follows:


    Context configuration file

    $Id: cm.xml,v 1.0 2004/12/21 17:03:34 remm Exp $


<Context docBase="C:\java\javatools\jakarta-tomcat-5.5.7\webapps\myfirstapp\"
         privileged="true" antiResourceLocking="false" antiJARLocking="false">

  <!– Link to the user database we will get roles from –>
  <ResourceLink name="users" global="UserDatabase"

  <Resource name="jdbc/database" auth="Container"
              type="javax.sql.DataSource" driverClassName=""
              username="app" password="app1" maxActive="20" maxIdle="10"


<Resource name="otherds" auth="Container"
                type="javax.sql.DataSource" driverClassName=""
                username="app" password="app1" maxActive="20" maxIdle="10"
              defaultTransactionIsolation="1" />


<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false">
      <Store className="org.apache.catalina.session.FileStore"/>



January 23, 2006 - Posted by | J2EE

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: