tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
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

Hi,
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 [mailto:ben.bookey@gistec-online.de]
>Sent: Wednesday, September 15, 2004 11:44 AM
>To: Tomcat User List
>Subject: Workaround for using JNDI sources in the web.xml instead of
the
>server.xml?
>
>Dear list,
>
>We use a datasource and realm for our app, which is currently inside of
the
>server.xml file
>for tomcat. This is used in the application descriptor (web.xml) to
control
>access.
>
>When my app. is packaged the server.xml is not inside the .war file.
This
>makes the installation
>task, just that little bit more complex. It would be nicer if the jdbc
>realm
>(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"
reloadable="true">
>          <Realm
>            className="org.apache.catalina.realm.JDBCRealm"
>            debug="99"
>            driverName="oracle.jdbc.driver.OracleDriver"
>            connectionURL="jdbc:oracle:thin:@111.111.111.11:1521:mySID"
>                     connectionName="myAppUser"
>                     connectionPassword="myAppUser"
>                     userTable="users"
>            	     userNameCol="user_name"
>                     userCredCol="user_pass"
>            userRoleTable="user_roles"
>            roleNameCol="role_name"/>
>
>          <Resource name="jdbc/myoracle" auth="Container"
>type="javax.sql.DataSource"/>
>	    <ResourceParams name="jdbc/myoracle">
>            <parameter>
>              <name>factory</name>
>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>            </parameter>
>            <parameter>
>              <name>driverClassName</name>
>              <value>oracle.jdbc.driver.OracleDriver</value>
>            </parameter>
>            <parameter>
>              <name>url</name>
>
<value>jdbc:oracle:thin:@111.111.111.11:1521:mySID</value>
>            </parameter>
>            <parameter>
>              <name>username</name>
>              <value>myAppUser</value>
>            </parameter>
>            <parameter>
>               <name>password</name>
>               <value>myAppUser</value>
>            </parameter>
>          </ResourceParams>
>        </Context>
>
>'======================================================================
====
>=
>=================================
>regards.
>
>Ben Bookey
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message