atom feed5 messages in org.apache.tomcat.usersRe: jdbc realm fails to authenticate ...
FromSent OnAttachments
Jeff WishnieOct 2, 2002 11:34 am 
echa...@TXU.COMOct 2, 2002 11:35 am 
Craig R. McClanahanOct 2, 2002 4:11 pm 
Paul PhillipsOct 2, 2002 4:25 pm 
John M. HollingsworthOct 4, 2002 10:22 am 
Subject:Re: jdbc realm fails to authenticate sometimes
From:John M. Hollingsworth (jmh_@cox.net)
Date:Oct 4, 2002 10:22:45 am
List:org.apache.tomcat.users

I have found the version of the MySQL connector to be the problem. Versions
earlier than 2.0.9 gave me the same problem you're experiencing. The latest
version is 2.0.14, I think.

John

From: "Paul Phillips" <pa@partitura.com> Date: 2002/10/02 Wed PM 07:25:40 EDT To: <tomc@jakarta.apache.org> Subject: jdbc realm fails to authenticate sometimes

Hello all

I am running Tomcat 4.1.10 and using a jdbc realm with mysql. It is setup accordingto the docs on the jakarta web site. (At least I think it is!)

The entry in my server.xml file looks like this:

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="org.gjt.mm.mysql.Driver" connectionURL="jdbc:mysql://localhost/authority" connectionName="me" connectionPassword="mypassword" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name"/>

I am finding occasional authentication failures that always follow the same pattern.I say occasional in that often the authentication works perfectly
well.

When it doesn't this is what happens... 1) user tries to authenticate (typing very carefully the username and password),tomcat throws error, sending user to error.jsp page. 2) Sometimes, on second attempt, authentication works, and user is allowed accessto webapp. 3) However, sometimes on second attempt, Tomcat throws a null pointer exception.If the user simply presses retry (on the browser) at that point,
he/she is allowedaccess to the application! So, in this case, somehow the authentication is takingplace on the second attempt, but an exception is being thrown
somewhere...

I was wondering if this had something to do with the 8 hour disconnect of mysql, andI added: autoreconnect=true to the URL above, but that didn't seem to fix the problem.

This is driving users of my webapp nuts (as you can imagine). Does anyone haveany ideas of where to look, or what I can do to avoid this?