Tomcat JDBC Realm Authentication Bug with MySQL?
From: Bruno Beloff (bruno.beloff_at_opmath.com)
Date: 11/28/03
- Next message: Marcel van Gellekom: "Applet JMenuItem Mnemonic + Accelerator Keys dont function"
- Previous message: Bruno Beloff: "Re: Javadoc - @see can't see abstract classes?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 Nov 2003 20:14:25 +0000
Hi.
I've found what might be a nasty bug, running Tomcat 4.1.29 on Mandrake 9.0
Linux with MySQL 4.0. I don't know what to make of this, and I'd really
appreciate any ideas.
I have a web application that runs fine all the time, except for one
instance: this is the case where the application has been dormant for some
time (perhaps 8 hours). At this point I try to access a URL controlled by a
security constraint. I get my log in form, complete the form, and attempt
to submit it. But I get a blank page, instead of the correct page.
At this point, Tomcat generates a new log file named catalina_log.<date>.txt
with the following content:
2003-11-28 19:43:48 CoyoteAdapter An exception or error occurred in the
container during the request processing
java.lang.StackOverflowError
Tomcat continues to run, but all further attempts to log in result in
duplicates of the same error. The server.xml entry for the application is
at the foot of this message.
It occurs to me that MySQL drops connections automatically after 8 hours.
That hasn't been a problem for me for the most part, because both my
application's data source configuration and the JDBC realm configuration set
'autoReconnect=true' as part of the JDBC URL. The rest of this application
(which makes use of MySQL via Tomcat's connection pooling) goes on running
fine, even when the authenticator has died.
So what's up? Have I configured the JDBC realm wrong? Is there some
work-around? Help please!
Bruno.
<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true"
crossContext="false" debug="1" displayName="Web Bookshop"
docBase="/var/tomcat4/webapps/wb"
mapperClass="org.apache.catalina.core.StandardContextMapper" path="/wb"
privileged="false" reloadable="true" swallowOutput="false" useNaming="true"
wrapperClass="org.apache.catalina.core.StandardWrapper">
<Loader className="org.apache.catalina.loader.WebappLoader"
checkInterval="15" debug="1" delegate="false"
loaderClass="org.apache.catalina.loader.WebappClassLoader"
reloadable="true"/>
<Logger className="org.apache.catalina.logger.FileLogger"
debug="0" directory="logs" prefix="localhost_wb_log." suffix=".txt"
timestamp="true" verbosity="1"/>
<Manager className="org.apache.catalina.session.StandardManager"
algorithm="MD5" checkInterval="60" debug="1" duplicates="0"
expiredSessions="0" maxActive="1" maxActiveSessions="-1"
maxInactiveInterval="-60" pathname="SESSIONS.ser"
randomClass="java.security.SecureRandom" rejectedSessions="0"
sessionCounter="4">
</Manager>
<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="tomcat" connectionPassword="tomcat"
connectionURL="jdbc:mysql://localhost/wb?autoReconnect=true" debug="9"
driverName="com.mysql.jdbc.Driver" roleNameCol="us_role"
userCredCol="us_password" userNameCol="us_name" userRoleTable="users"
userTable="users" validate="true"/>
<Resource name="jdbc/wb" scope="Shareable"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/wb">
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>6</value>
</parameter>
<parameter>
<name>password</name>
<value>tomcat</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/wb?autoReconnect=true</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
<parameter>
<name>username</name>
<value>tomcat</value>
</parameter>
</ResourceParams>
</Context>
- Next message: Marcel van Gellekom: "Applet JMenuItem Mnemonic + Accelerator Keys dont function"
- Previous message: Bruno Beloff: "Re: Javadoc - @see can't see abstract classes?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|