Hello,

Tomcat: 8.0.22
Java: jdk1.8.0_05
Server: Amazon Linux

My web application looses access to the database after about 24hrs of
running (probably dependent on amount of users, not time).

No messages/exceptions are printed to the console or log files.

When I stop tomcat, then I get a few "INFO" message
("org.apache.catalina.core.StandardWrapper.unload Waiting for [number]
instance(s) to be deallocated for Servlet")
followed by a long list of all the SQLExceptions ("cannot get a connection,
general error") and Warnings
("org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads
The web application is still processing a request that has yet to
finish...").

I think the Servlet specified in the INFO messages, the stack trace of the
SQLExceptions and the stack trace of the Warnings is just specific to
whichever Servlet was called and not to which Servlet/method is at the root
of what is causing this issue.

I assume this is something in my application. I have looked over changes
that I made to the code recently and haven't found anything (all
connections, Statements, ResultSets are closed after being used).

The beginning of the stack trace that appears after the warning:
sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 
org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:582)
 
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:439)
 
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
 
org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:118)
 
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)


The beginning of the stack trace that appears after the SQLException:
at
org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:130)
        at
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
        at data.ConnectionPool.getConnection(ConnectionPool.java:64)
...
and then:
Caused by: java.lang.InterruptedException
        at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
        at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)
        at
org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:582)
        at
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:439)
        at
org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
        at
org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:118)

Any ideas as to what is going on?

I took a thread dump, but I'm not too good at analyzing those. If anyone
has any recommendations as to what to look out for in the thread dump I'd
be interested in hearing it.

Thank you.

Reply via email to