Chris,

To answer your question, Chris, I do a post to j_security_check.  Actually,
my "login" link really just does a GET for a secured resource and Tomcat
serves up a standard j_security_check form.  I only post j_username and
j_password, so don't expect max size to be a problem.  I was not able to
reproduce the problem this morning, but after pouring through the logs I
found an exception that shed some light on the problem.

I saw a "connection already closed" message from one of my DAOs and I found
a SQLExceptions from MOD_JK.  It looks like on of my DAOs left a transaction
open and the login error is really just fallout from that.  I have a TODO to
replace my transaction logic with Spring transactions.  I'll see if the
problem goes away after I do that.  Here is the error:

ERROR | 2007-12-13 20:53:36,085 [TP-Processor11]
org.apache.catalina.core.ContainerBase.[Catalina].[www.homesassn.com].[/]  -
Exception performing authentication
java.sql.SQLException: Communications link failure during commit().
Transaction resolution unknown.
        at com.mysql.jdbc.Connection.commit(Connection.java:2171)
        at org.apache.catalina.realm.JDBCRealm.getPassword(JDBCRealm.java
:568)
        at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java
:399)
        at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java
:347)
        at org.apache.catalina.authenticator.FormAuthenticator.authenticate(
FormAuthenticator.java:257)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
AuthenticatorBase.java:416)
        at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
        at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(
FastCommonAccessLogValve.java:495)
        at org.apache.catalina.valves.AccessLogValve.invoke(
AccessLogValve.java:541)
        at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java
:199)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java
:282)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(
ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(
ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)

The realm is nothing unusual:

<Realm  className="org.apache.catalina.realm.JDBCRealm"
                        debug="99"
                        driverName="com.mysql.jdbc.Driver"

connectionURL="jdbc:mysql://localhost:3306/[xxxxxxxx]"
                        connectionName="[xxxxxxxx]"
                        connectionPassword="[xxxxxxxx]"
                        userTable="USERS" userNameCol="SIGNON_ID"
userCredCol="CREDENTIAL"
                        userRoleTable="ENTITLEMENTS"
roleNameCol="ENTITLEMENT_NAME"
        />

Thanks,
Steve

Chris wrote:
> Steve,
>
>> Steve Mitchell wrote:
>> I'm using a JDBC realm with a site and sometimes when you try to
>> access a secured resource you get a blank page after logging in.  You
>> have to refresh the page to get the secured resource to appear. After
>> that everything works great.
>
>Does it happen to be a POST request that initiates the login? Tomcat has
>a certain maximum size (can't remember off the top of my head) for POST
>requests that it will properly re-process after a login.
>
>> This appears to only happen on the first login.
>
>First login when? After a server restart? Ever on a given browser?
>First login for whom? The first user to hit the server at all after a
>restart, or the first time a particular user logs in from anywhere?
>
>- -chris

Reply via email to