Tomcat 6.0.32 +Spring dbcp datasource关闭Tomcat出现严重异常
异常如下:
信息: 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出现严重异常的更多相关文章
- 朝圣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 ...
- Linux Tomcat 6.0安装配置实践总结
系统环境: Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64位 Tomcat下载 从官方网站 http://tomcat.apache ...
- 实践补充 Installing Tomcat 7.0.x on OS X
我的 Mac 下是1.6的 SDK,下载 Tomcat 8.0 执行后,訪问 http://127.0.0.1:8080 并无反应,并且关闭脚本会报错 : Unsupported major.mino ...
- Target runtime Apache Tomcat v6.0 is not defined
在工程目录下的.settings文件夹里,打开org.eclipse.wst.common.project.facet.core.xml文件,其内容是: <?xml version=" ...
- Solr 5.5.0 + tomcat 7.0.69 + zookeeper-3.4.6 Cloud部署
Solr介绍:Solr是一个独立的企业级搜索应用服务器,Solr基于Lucene的全文搜索服务器,同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展并对查询性能进行了 ...
- tomcat 8.0 进程没有全部杀死
The web application [FileIO_new_interface] created a ThreadLocal with key of type [java.lang.ThreadL ...
- Mac 下如何下载、启动和关闭Tomcat 和管理Mac自带的Apache
Mac 下载.启动和关闭Tomcat 1. 下载Tomcat(地址:tomcat.apache.org),选择适合的版本(这里选择6.0.48),点击“Download”,之后在新页面点击“Core ...
- tomcat 9.0.4 性能调优
参考了网上的一些优化参数,但是在启动中发现 有2个报错: 11-Feb-2018 15:57:23.293 警告 [main] org.apache.catalina.startup.SetAllPr ...
- linux 系统下配置tomcat,并给tomcat赋予最高操作权限,启动tomcat和关闭tomcat
配置tomcat服器 sudo chmod -R 777 * 给某个文件下所有文件赋予最高的读写权限 红颜色的字是路径,蓝颜色字是命令 (1)官方网站下载tomcat压缩包.apache-tomcat ...
随机推荐
- SharedPreferences数据、openFileOutput文件、SQLite数据库文件存储位置
在模拟器中: SharedPreferences将XML文件保存在/data/data/<package name>/shared_prefs目录下, openFileOutput方法将文 ...
- Simple Event Correlation installation and configuration
http://searchenterpriselinux.techtarget.com/tip/Simple-Event-Correlation-installation-and-configurat ...
- Linux & Python 导航目录
< Python学习手册(第4版)>< Python Cookbook(第2版)>中文版.pdf< Python 高级编程>< Python 基础教程 第二版 ...
- linux文件合并
第一:两个文件的交集,并集前提条件:每个文件中不得有重复行1. 取出两个文件的并集(重复的行只保留一份)2. 取出两个文件的交集(只留下同时存在于两个文件中的文件)3. 删除交集,留下其他的行1. c ...
- 2015第22周六Java反射、泛型、容器简介
Java的反射非常强大,传递class, 可以动态的生成该类.取得这个类的所有信息,包括里面的属性.方法以及构造函数等,甚至可以取得其父类或父接口里面的内容. obj.getClass().getDe ...
- 什么是空间复杂度(What is actually Space Complexity ?)
属于空间复杂度(Space Complexity)在很多情况下被错认为是附属空间(Auxiliary Space),下面是附属空间和空间复杂度的定义. 附属空间(Auxiliary Space)是算法 ...
- hdu2531之BFS
Catch him Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- poj1014 Dividing (多重背包)
转载请注明出处:http://blog.csdn.net/u012860063 题目链接:id=1014">http://poj.org/problem?id=1014 Descrip ...
- 【Spark】Spark的Shuffle机制
MapReduce中的Shuffle 在MapReduce框架中,shuffle是连接Map和Reduce之间的桥梁,Map的输出要用到Reduce中必须经过shuffle这个环节,shuffle的性 ...
- python - 面向对象(二)
类的三大特性 类的三大特性包括: 封装.继承.多态 一.封装 封装就是将类所用到的所有字段.属性.方法都包含在类代码段里面,当实例调用直接调用类中的方法即可. class People(object) ...