You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lea <le...@applimedia.com> on 2004/06/07 16:26:06 UTC
JDBCRealm problem (invalid port number)
Hi,
I'm trying to use JDBCRealm and MySQL to authenticate user in tomcat 4.1.
I followed the steps described on
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-
howto.html#JDBCRealm:
I added a user table and a user_roles table in my database (ABCDatabase);
I made all necessary columns (user, password, role_name);
I downloaded the MySQL driver (mysql-connector-java-3.0.14-
production.zip) and put the .jar file into $CATALINA/common/lib;
I replaced the realm definition of the server.xml by follow code snippet
:
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost_IP/ABCDatabase" <!-- *
-->
connectionName="root"
connectionPassword=""
userTable="user" userNameCol="login" userCredCol="password"
userRoleTable="user_roles" roleNameCol="role_name" />
I created the new user in slide/users/ with the same name and password as
in my user table in the mysql server.
I can login in http://localhost:8080/admin with this user (he's not in
tomcat-users.xml) using IE, but when I use a terminal as jakarta-slide-
webdavclient-2.0, I got the follow error message:
org.apache.commons.httpclient.URIException: invalid port number
I replaced the connectionURL (the line with <!-- * --> ) by lines below,
but I got the same error.
connectionURL="jdbc:mysql://localhost_IP:3306/ABCDatabase"
connectionURL="jdbc:mysql://localhost/ABCDatabase"
connectionURL="jdbc:mysql://localhost:3306/ABCDatabase"
I remark that there's nothing about JDBCRealm neither JDBC in the login
file (/logs/localhost_log.txt).
Does someone know what's wrong in my program?
Thx and regards
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org