• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DataSourceRealm is being ignored

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic