Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBCRealm and tomcat

843838Sep 14 2006 — edited Sep 21 2006
hi,
I need some serious help in setting up JDBCRealm in tomcat...i tired for a full day without any success
  <Realm
      className="org.apache.catalina.realm.JDBCRealm"
      debug="99"      
      driverName="com.mysql.jdbc.Drier"
      connectionURL="jdbc:mysql://localhost/form"
      connectionName="root"
      connectionPassword=""
      userTable="member"
      userNameCol="username"
      userCredCol="password"
      userRoleTable="privilege"
      roleNameCol="role"  / >
Everytime I try to login it takes me to the error page....and the nothing comes out in the log

I have this web.xml configuration:

<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>

<url-pattern>/app/*
</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>member</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>FORM</auth-method>
<realm-name>test realms</realm-name>
<form-login-config>
<form-login-page>/index1.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page> 
</form-login-config>
</login-config>

<security-role>
<description>Memberss</description>
<role-name>member</role-name>
</security-role> 
The mysql tables look like this
CREATE TABLE `member` (
  `member_id` int(11) NOT NULL auto_increment,
  `username` varchar(30) character set utf8 NOT NULL default '',
  `password` varchar(80) character set utf8 collate utf8_bin NOT NULL default '',
  `role` int(11) NOT NULL default '0',
  PRIMARY KEY  (`member_id`),
  UNIQUE KEY `username` (`username`),

) ;


CREATE TABLE `privilege` (
  `role_user` varchar(30) character set utf8 NOT NULL default '',
  `role` varchar(30) character set utf8 NOT NULL default '',
  PRIMARY KEY  (`role_user`)
Yet, I can never access the database even with the data inserted is correct
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2006
Added on Sep 14 2006
12 comments
417 views