tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Workaround for using JNDI sources in the web.xml instead of the server.xml?
Date Wed, 15 Sep 2004 15:46:31 GMT

In Tomcat 5 you can use a context.xml file, which contains the <Context>
tag for your app (including any Realms and JNDI resources), and put that
context.xml in the META-INF directory of your WAR file.  That way you
don't have to put this information in server.xml.

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Ben Bookey []
>Sent: Wednesday, September 15, 2004 11:44 AM
>To: Tomcat User List
>Subject: Workaround for using JNDI sources in the web.xml instead of
>Dear list,
>We use a datasource and realm for our app, which is currently inside of
>server.xml file
>for tomcat. This is used in the application descriptor (web.xml) to
>When my app. is packaged the server.xml is not inside the .war file.
>makes the installation
>task, just that little bit more complex. It would be nicer if the jdbc
>(referenced in the web.xml) could
>be installed along with the .war file.  Can anyone make a suggestion?
> <Context path="/myApp" docBase="D:\MyProjects\myApp"
>          <Realm
>            className="org.apache.catalina.realm.JDBCRealm"
>            debug="99"
>            driverName="oracle.jdbc.driver.OracleDriver"
>            connectionURL="jdbc:oracle:thin:@"
>                     connectionName="myAppUser"
>                     connectionPassword="myAppUser"
>                     userTable="users"
>            	     userNameCol="user_name"
>                     userCredCol="user_pass"
>            userRoleTable="user_roles"
>            roleNameCol="role_name"/>
>          <Resource name="jdbc/myoracle" auth="Container"
>	    <ResourceParams name="jdbc/myoracle">
>            <parameter>
>              <name>factory</name>
>            </parameter>
>            <parameter>
>              <name>driverClassName</name>
>              <value>oracle.jdbc.driver.OracleDriver</value>
>            </parameter>
>            <parameter>
>              <name>url</name>
>            </parameter>
>            <parameter>
>              <name>username</name>
>              <value>myAppUser</value>
>            </parameter>
>            <parameter>
>               <name>password</name>
>               <value>myAppUser</value>
>            </parameter>
>          </ResourceParams>
>        </Context>
>Ben Bookey
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message