解决在IDEA中启动springboot的web项目报关闭线程失败错误

在IDEA中启动springboot的web项目报错:

2019-02-14 16:52:39,475|WARN |localhost-startStop-1|o.a.c.loader.WebappClassLoaderBase|180|The web application [ROOT] 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.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)

原因是mysql-connector的bug,把mysql-connector依赖的版本改成5.1.41以上即可

mysql
mysql-connector-java
5.1.46

参考官网:https://dev.mysql.com/doc/relnotes/connector-j/5.1/en/news-5-1-41.html上面的Bug Fixed部分:

When the default Tomcat configuration is used and the Connector/J jar is put into a local library directory, 
the new built-in application detector in Connector/J now detects the stopping of the web application within 5 seconds and kills AbandonedConnectionCleanupThread. Any unnecessary warnings about the thread being unstoppable are also avoided. 
If the Connector/J jar is put into a global library directory, the thread is left running until the JVM is unloaded.

猜你喜欢

转载自blog.csdn.net/lzufeng/article/details/87283143
今日推荐