当前位置: 代码迷 >> 综合 >> Abandoned connection cleanup thread failed to stop
  详细解决方案

Abandoned connection cleanup thread failed to stop

热度:14   发布时间:2024-01-04 01:00:17.0

问题:

 A web application 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.

在这里插入图片描述

解决:

  1. 升级mysql-connector-java版本。

  2. 引入:

@Component
public class ShutdownListener implements ServletContextListener {
    @Overridepublic void contextInitialized(ServletContextEvent sce) {
    }@Overridepublic void contextDestroyed(ServletContextEvent sce) {
    AbandonedConnectionCleanupThread.checkedShutdown();}
}

参考:https://bugs.mysql.com/bug.php?id=69526
在这里插入图片描述

  相关解决方案