錯誤這樣樣子:
警告: The web application [community4] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
mysql的cleanup的線程沒有關閉而已。
可以在ServletContextListener裏如下代碼:
AbandonedConnectionCleanupThread.shutdown();
Thread.sleep(2000);
Thread.sleep(2000);是爲了確保不會打印該異常