tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: java.lang.IllegalStateException: Timer already cancelled
Date Tue, 06 Jul 2010 09:07:44 GMT
On 06/07/2010 08:22, Pid wrote:
> On 06/07/2010 08:05, Yevgen Krapiva wrote:
>> Hi guys.
>>
>> I have a servlet that uses connection pool with the use of MySQL drive=
r.
>> When I start or reload Tomcat the application works fine, then if I
>> redeploy my application it cannot get a connection from a DataSource o=
bject.
>> The following exception is thrown:
>>
>> java.lang.IllegalStateException: Timer already cancelled.
>>
>> java.util.Timer.sched(Timer.java:354)
>> java.util.Timer.schedule(Timer.java:222)
>> org.apache.tomcat.dbcp.pool.impl.EvictionTimer.schedule(EvictionTimer.=
java:64)
>> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.startEvictor(Generi=
cObjectPool.java:1647)
>> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.setTimeBetweenEvict=
ionRunsMillis(GenericObjectPool.java:843)
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicData=
Source.java:1173)
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSou=
rce.java:880)
>> basis.onlineorder.commons.dao.UserDAOJdbcImpl.getUsers(UserDAOJdbcImpl=
=2Ejava:133)
>> org.apache.jsp.users_jsp.getUsersList(users_jsp.java:31)
>> org.apache.jsp.users_jsp._jspService(users_jsp.java:164)
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.=
java:377)
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:31=
3)
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>
>> I have not found anything I can do with this on the internet. Perhaps =
I've
>> found that I might have a relation to
>> timeBetweenEvictionRunsMillis parameter ( in <Resource> configuration
>> section ).
>>
>> I don't know if it is important, here is my configuration in context.x=
ml
>> file:
>>
>> <Resource name=3D"jdbc/onlineorder"
>> auth=3D"Container"
>> type=3D"javax.sql.DataSource"
>> username=3D"user"
>> password=3D"password"
>> driverClassName=3D"com.mysql.jdbc.Driver"
>> url=3D"jdbc:mysql://localhost/mydb?useUnicode=3Dtrue&amp;characterEnco=
ding=3Dutf8"
>> maxActive=3D"10"
>> maxIdle=3D"5"
>> testOnBorrow=3D"true"
>> testWhileIdle=3D"true"
>> timeBetweenEvictionRunsMillis=3D"10000"
>> minEvictableIdleTimeMillis=3D"60000"
>> />
>>
>> Did anyone face with this problem ?
>=20
> Exactly which version of the MySQL driver are you using?
>=20
> This is a side-effect of the memory leak prevention in Tomcat 6.0.20+
> which aims to stop Timers that haven't been properly shutdown.

Correction, Timer Thread termination was introduced in 6.0.24.
It's optional from 6.0.27 with the clearReferencesStopTimerThreads flag.

You might consider filing a bug with MySQL requesting that they check
that the Timer is actually running.


p


p


Mime
View raw message