I am trying use HikariCP JNDI DataSource Factory within Tomcat 8.5 but when it shutdown I'm getting these warning:
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)
My Hiraki configuration was setup following the JNDI DataSource Factory (Tomcat, etc.) document, and is something like this:
<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="******" />
I've found this link but it doesn't help because I'm using Hiraki as a resource inside Tomcat.
I'm using Tomcat 8.5 HikariCP 2.5.1
Any help? Thanks.
I had faced the exact same problem, at-least the error message was the same. The error message says that there is a problem with Hikari-Pool configuration but actually your Tomcat is failing to start. A simple solution is to check your application for any run-time error. In my case, in my Rest-Controller, I had declared the same HTTP-Method with the same URI endpoint but with different method names. Thus, it wasn't a compile time error but during build of Tomcat it fails, causing HikariPool to throw a error message.
Hope it helps. If this doesn't works do comment, maybe I could help.
All you need to add is this at the end of your Resource:
closeMethod="close"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With