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

5 篇文章 0 订阅

在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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值