I am having trouble setting up a datasource realm in TC 5.5.0. Below are the steps I have taken from
TC 5.5 documentation.
1.If you have not yet done so, create tables and columns in your database that conform to the requirements described above.
- I created a table "users" with columns "user_name" and "user_pass".
- I created a table "user_roles" with columns "user_name" and "role_name".
- Both have read permissions.
2. Configure a database username and password for use by Tomcat, that has at least read only access to the tables described above. (Tomcat will never attempt to write to these tables.)
- I am unsure about this. For my datasource I already have a username/password - will this suffice?
3. Configure a JNDI named JDBC DataSource for your database. Refer to the JNDI DataSource Example HOW-TO for information on how to configure a JNDI named JDBC DataSource.
- I already have DBCP working. See below server.xml and context.xml excerpts.
4. Set up a <Realm> element, as described below, in your $CATALINA_HOME/conf/server.xml file.
For dataSourceName I was unsure of what I should use but I have tried "java:comp/env/jdbc/connectDB" and "jdbc/connectDB".
5. Restart Tomcat 5 if it is already running.
When I go to http:localhost:8080/MyContextName I am prompted to authenticate but it's not registering my username/password. After three attempts I get a 401 error page.
I've been looking at this for a few days and I do not see(obvious I am sure) what I am doing wrong. If someone could point out where I went wrong - I'd appreciate it. Thanks in advance!
Crystal
[ January 22, 2007: Message edited by: Crystal Bazil ]
[ January 22, 2007: Message edited by: Crystal Bazil ]