异常如下:

信息: Pausing Coyote HTTP/1.1 on http-
-- :: org.apache.catalina.core.StandardService stop
信息: Stopping service Catalina
-- :: 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.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/tsmanager] appears to have started a thread named [scheduler_Worker-] but has failed to stop it. This is very likely to create a memory leak.
-- :: org.apache.coyote.http11.Http11Protocol destroy
信息: Stopping Coyote HTTP/1.1 on http-
[QC] INFO [main] org.springframework.context.support.AbstractApplicationContext.doClose() | Closing Root WebApplicationContext: startup date [Thu Mar :: CST ]; root of context hierarchy
[QC] INFO [main] org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop() | Stopping beans in phase
[QC] INFO [main] org.quartz.core.QuartzScheduler.standby() | Scheduler scheduler_$_yanshiying-PC1394088762202 paused.
[QC] INFO [main] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons() | 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() | Shutting down Quartz Scheduler
[QC] INFO [main] org.quartz.core.QuartzScheduler.shutdown() | Scheduler scheduler_$_yanshiying-PC1394088762202 shutting down.
[QC] INFO [main] org.quartz.core.QuartzScheduler.standby() | Scheduler scheduler_$_yanshiying-PC1394088762202 paused.
[QC] INFO [main] org.quartz.core.QuartzScheduler.shutdown() | Scheduler scheduler_$_yanshiying-PC1394088762202 shutdown complete.

Tomcat版本为:6.0.32

spring数据源配置如下:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/wzhpush"/>
<property name="username" value="root"/>
<property name="password" value="mysqladmin"/>
</bean>

原因: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();
}
}

Tomcat 6.0.32 +Spring dbcp datasource关闭Tomcat出现严重异常的更多相关文章

  1. 朝圣Java(问题集锦)之:The Apache Tomcat installation at this directory is version 8.5.32. A Tomcat 8.0 inst

    最近开始学Java了.有C#底子,但是学起来Java还是很吃力,感觉别人架好了各种包,自己只要调用就行了,结果还有各种bug出现.掩面中. 启动Tomcat的时候,报错The Apache Tomca ...

  2. Linux Tomcat 6.0安装配置实践总结

    系统环境: Red Hat Enterprise Linux Server release 5.7 (Tikanga)  64位 Tomcat下载 从官方网站 http://tomcat.apache ...

  3. 实践补充 Installing Tomcat 7.0.x on OS X

    我的 Mac 下是1.6的 SDK,下载 Tomcat 8.0 执行后,訪问 http://127.0.0.1:8080 并无反应,并且关闭脚本会报错 : Unsupported major.mino ...

  4. Target runtime Apache Tomcat v6.0 is not defined

    在工程目录下的.settings文件夹里,打开org.eclipse.wst.common.project.facet.core.xml文件,其内容是: <?xml version=" ...

  5. Solr 5.5.0 + tomcat 7.0.69 + zookeeper-3.4.6 Cloud部署

    Solr介绍:Solr是一个独立的企业级搜索应用服务器,Solr基于Lucene的全文搜索服务器,同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展并对查询性能进行了 ...

  6. tomcat 8.0 进程没有全部杀死

    The web application [FileIO_new_interface] created a ThreadLocal with key of type [java.lang.ThreadL ...

  7. Mac 下如何下载、启动和关闭Tomcat 和管理Mac自带的Apache

     Mac 下载.启动和关闭Tomcat 1. 下载Tomcat(地址:tomcat.apache.org),选择适合的版本(这里选择6.0.48),点击“Download”,之后在新页面点击“Core ...

  8. tomcat 9.0.4 性能调优

    参考了网上的一些优化参数,但是在启动中发现 有2个报错: 11-Feb-2018 15:57:23.293 警告 [main] org.apache.catalina.startup.SetAllPr ...

  9. linux 系统下配置tomcat,并给tomcat赋予最高操作权限,启动tomcat和关闭tomcat

    配置tomcat服器 sudo chmod -R 777 * 给某个文件下所有文件赋予最高的读写权限 红颜色的字是路径,蓝颜色字是命令 (1)官方网站下载tomcat压缩包.apache-tomcat ...

随机推荐

  1. cf B. Vasya and Public Transport

    http://codeforces.com/contest/355/problem/B #include <cstdio> #include <cstring> #includ ...

  2. codeforces Ilya and Matrix

    http://codeforces.com/contest/313/problem/C #include <cstdio> #include <cstring> #includ ...

  3. 10g中注意谓词过滤的位置

    在10g中当主查询的谓词信息,被错误的放入子查询中,会导致子查询无法展开 explain plan for UPDATE DWF.F_PTY_INDIV O SET END_DT = TO_DATE( ...

  4. cf493D Vasya and Chess

    D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  5. Best Cow Line (POJ 3617)

    题目: 给定长度为N的字符串S,要构造一个长度为N的字符串T.起初,T是一个空串,随后反复进行下列任意操作. ·从S的头部删除一个字符,加到T的尾部 ·从S的尾部删除一个字符,加到T的尾部 目标是要构 ...

  6. MySql 查询表字段数

    MySql 查询表字段数 SELECT COUNT(*) FROM information_schema.columns WHERE table_schema='test_cases' AND tab ...

  7. java 字符串为空问题

    java 字符串为空问题 String testStr = null; System.out.println(testStr); if (testStr == null) { System.out.p ...

  8. swift 随机数

    1.一行代码生成随机数  arc4random() 如果要生成一个生成在一定范围内的随机整数: func randomIn(#min: Int, max: Int) -> Int { retur ...

  9. [Javascript] Web APIs: Persisting browser data with window.localStorage

    Local Storage is a native JavaScript Web API that makes it easy to store and persist data (as key-va ...

  10. 自定义seekbar中,thumb被覆盖掉一部分问题