I have an application running in
Tomcat 5.5 for which I have set up a <Context> and a
JDBC Data Source. I have attempted to protected my site using a DataSourceRealm, but Tomcat ignores these settings. Here are the specific configurations:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context debug="99" reloadable="true" crossContext="true">
<Resource name="jdbc/myoracle"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:xe"
username="abc123"
password="abc123"
maxActive="50"
maxIdle="50"
maxWait="10"
minIdle="2"
/>
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/myoracle"
userTable="patients"
userNameCol="patient_id"
userCredCol="password"
userRoleTable="user_roles"
roleNameCol="role"
localDataSource="true"
/>
</Context>
Following is my web.xml for this application:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<security-constraint>
<web-resource-collection>
<web-resource-name>
ProtectedPages
</web-resource-name>
<url-pattern>
/*
</url-pattern>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>
BASIC
</auth-method>
</login-config>
<resource-ref>
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Is there some other configuration I need to do with Tomcat 5.5? I have had this working in Tomcat 4.x, but can't make it work on the newer version.
Thanks,
TGF