Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tomcat JDBC securityRealm for mySQL

Status
Not open for further replies.

goaganesha

Programmer
Dec 4, 2001
178
0
0
BE
Hi,

I'm using a Mysql database for my website and I want to use the JDBCRealm provided by tomcat to do the authorization.

I read in a book that I need to add an entry to the tomcat server.xml file which is located in the conf directory under tomcat. Here's the code that I added and the existing piece that I have put in commentlines:
Code:
<!--	<Realm className=&quot;org.apache.catalina.realm.MemoryRealm&quot;/>-->
			
<!-- Replace the above Realm with one of the following to get a Realm  stored in a database and accessed via JDBC -->

<Context path=&quot;/farma&quot; docbase=&quot;webapps/farma&quot; debug=&quot;0&quot; reloadable=&quot;true&quot;>
						<Realm className=&quot;org.apache.catalina.realm.JDBCRealm&quot; debug=&quot;99&quot; driverName=&quot;org.gjt.mm.mysql.Driver&quot; connectionURL=&quot;jdbc:mysql://localhost:3306/farma_db&quot; userTable=&quot;user&quot; userNameCol=&quot;username&quot; userCredCol=&quot;password&quot; userRoleTable=&quot;userrole&quot; roleNameCol=&quot;rolename&quot;/>
</Context>

The problem is that if I add this code, my tomcat server won't start up. If I leave the Context opening and closing tags away it works fine but after logging in I get an error saying that no path for redirecting is provided.
Do I need to put these context tags somewhere else or is there another problem?

Thanks in advance for your help.

Regards,

goaganesha
 
goaganesha,
Can you tell me how you solved this?

Chuck T.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top