博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Tomcat 6.0.32 +Spring dbcp datasource关闭Tomcat出现严重异常
阅读量:6323 次
发布时间:2019-06-22

本文共 5578 字,大约阅读时间需要 18 分钟。

异常如下:

信息: Pausing Coyote HTTP/1.1 on http-80802014-3-6 14:52:50 org.apache.catalina.core.StandardService stop信息: Stopping service Catalina2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc严重: The web application [/tsmanager] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-4] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-6] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-7] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-8] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-9] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak.2014-3-6 14:52:50 org.apache.coyote.http11.Http11Protocol destroy信息: Stopping Coyote HTTP/1.1 on http-8080[QC] INFO [main] org.springframework.context.support.AbstractApplicationContext.doClose(1002) | Closing Root WebApplicationContext: startup date [Thu Mar 06 14:52:41 CST 2014]; root of context hierarchy[QC] INFO [main] org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(345) | Stopping beans in phase 2147483647[QC] INFO [main] org.quartz.core.QuartzScheduler.standby(556) | Scheduler scheduler_$_yanshiying-PC1394088762202 paused.[QC] INFO [main] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(422) | Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1ac7fbb: defining beans [dataSource,jdbcTemplate,xxtsService,wpushDao,httpUtil,cronService,clearDataJob,getNsrInfoJob,scheduler,quartzManager]; root of factory hierarchy[QC] INFO [main] org.springframework.scheduling.quartz.SchedulerFactoryBean.destroy(760) | Shutting down Quartz Scheduler[QC] INFO [main] org.quartz.core.QuartzScheduler.shutdown(635) | Scheduler scheduler_$_yanshiying-PC1394088762202 shutting down.[QC] INFO [main] org.quartz.core.QuartzScheduler.standby(556) | Scheduler scheduler_$_yanshiying-PC1394088762202 paused.[QC] INFO [main] org.quartz.core.QuartzScheduler.shutdown(707) | Scheduler scheduler_$_yanshiying-PC1394088762202 shutdown complete.

Tomcat版本为:6.0.32

spring数据源配置如下:

原因:https://issues.apache.org/jira/browse/DBCP-332

BasicDataSource's method close() doesn't deregister JDBC driver. This causes permgen memory leaks in web server environments, during context reloads. For example, using Tomcat 6.0.26 with Spring, and BasicDataSource declared in Spring context, there is a message printed at web application reload:

SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

解决方法:

import java.sql.DriverManager;import java.sql.SQLException;import org.apache.commons.dbcp.BasicDataSource;/** * 解决 关闭Tomcat时报错:the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped * @author*/public class WzhBasicDataSource extends BasicDataSource{    @Override    public synchronized void close() throws SQLException {        DriverManager.deregisterDriver(DriverManager.getDriver(url));        super.close();    }}

 

 

转载地址:http://etpaa.baihongyu.com/

你可能感兴趣的文章
C# 实现数字字符串左补齐0的两种方法
查看>>
购物车测试点
查看>>
搭建Hexo博客
查看>>
Pascal之Hello World
查看>>
Leetcode题目:Range Sum Query - Immutable
查看>>
C#Hashtable与Dictionary比较性能
查看>>
SAP FICO hande汉得培训资料---IV 资产模块篇PDF 电子版
查看>>
JAVA LIST 排序方法
查看>>
electron安装
查看>>
最短路径算法实现
查看>>
验证码的案例代码
查看>>
JavaScript 之 function函数及参数arguments
查看>>
Oracle——DQL、DML、DDL、DCL
查看>>
压缩与解压缩
查看>>
【前端】stopPropagation, preventDefault, return false的区别
查看>>
JS基础
查看>>
Python3 简单验证码识别思路及实例
查看>>
Hadoop综合大作业
查看>>
SilverLight商业应用程序开发---学习笔记(2)
查看>>
Ajax:进度条
查看>>