我正在尝试在Tomcat 8.5中使用HikariCP JNDI数据源工厂,但是当它关闭时,我会收到以下警告:
o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [HikariPool-1 housekeeper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
我的Hiraki配置是按照JNDI DataSource Factory (Tomcat等) 文档设置的,类似于这样:
<Resource name="******" auth="Container"
factory="com.zaxxer.hikari.HikariJNDIFactory"
type="javax.sql.DataSource"
minimumIdle="5"
maximumPoolSize="10"
connectionTimeout="300000"
driverClassName="org.postgresql.Driver"
jdbcUrl="jdbc:postgresql://******"
dataSource.implicitCachingEnabled="true"
dataSource.user="******"
dataSource.password="******" />
我找到了这个链接,但它并没有帮助我,因为我正在将Hiraki作为Tomcat内的资源使用。
我正在使用Tomcat 8.5 HikariCP 2.5.1
有人能帮忙吗?谢谢。