goaganesha
Programmer
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:
<!-- <Realm className="org.apache.catalina.realm.MemoryRealm"/>-->
<!-- Replace the above Realm with one of the following to get a Realm stored in a database and accessed via JDBC -->
<Context path="/farma" docbase="webapps/farma" debug="0" reloadable="true">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="org.gjt.mm.mysql.Driver" connectionURL="jdbc:mysql://localhost:3306/farma_db" userTable="user" userNameCol="username" userCredCol="password" userRoleTable="userrole" roleNameCol="rolename"/>
</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.
If someone has a working server.xml file with the JDBCRealm for mysql enabled, I would really appreciate it if you could give me the URL so I can use it as an example.
Regards,
goaganesha
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:
<!-- <Realm className="org.apache.catalina.realm.MemoryRealm"/>-->
<!-- Replace the above Realm with one of the following to get a Realm stored in a database and accessed via JDBC -->
<Context path="/farma" docbase="webapps/farma" debug="0" reloadable="true">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="org.gjt.mm.mysql.Driver" connectionURL="jdbc:mysql://localhost:3306/farma_db" userTable="user" userNameCol="username" userCredCol="password" userRoleTable="userrole" roleNameCol="rolename"/>
</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.
If someone has a working server.xml file with the JDBCRealm for mysql enabled, I would really appreciate it if you could give me the URL so I can use it as an example.
Regards,
goaganesha