【解决Tomcat启动异常】To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

INFO: Deploying configuration descriptor host-manager.xml
Dec 30, 2014 3:25:52 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Dec 30, 2014 3:25:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Dec 30, 2014 3:25:52 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
14-12-30 15:25:52,801 INFO  org.springframework.web.context.support.XmlWebApplicationContext - Closing org.springframework.web.context.support.XmlWebApplicationContext@2b499ae: display name [Root WebApplicationContext]; startup date [Tue Dec 30 15:25:45 CST 2014]; root of context hierarchy
14-12-30 15:25:52,802 INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@284f1e63: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#1,CommonDataSource,orderDao,CommonSessionFactory,gmCommonService,adminsService,channelService,CommonBaseServiceImpl,CommonBaseHibernateDao,CommonHibernateDaoSupport,CommonHibernateTemplate,dataSource,sessionFactory,rechargeOrdersTask,coinsLogTask,onlinePlayerStatisticTask,playersTask,loginLogTask,storeSalesLogTask,itemsLogTask,rechargeOrdersService,coinsLogService,onlinePlayerStatisticService,playersService,loginLogService,storeSalesLogService,itemsLogService,playerInfoDao,serversService,payPlatformService,orderService,baseServiceImpl,baseHibernateDao,HibernateDaoSupport,HibernateTemplate,configProperties,propertyConfigurer,SchedulerTaskService,quartzJob,quartzTrigger,job]; root of factory hierarchy
14-12-30 15:25:52,802 INFO  org.springframework.scheduling.quartz.SchedulerFactoryBean - Shutting down Quartz Scheduler
14-12-30 15:25:52,807 INFO  org.springframework.orm.hibernate3.LocalSessionFactoryBean - Closing Hibernate SessionFactory
14-12-30 15:25:52,807 INFO  org.hibernate.impl.SessionFactoryImpl - closing
14-12-30 15:25:52,809 INFO  org.springframework.orm.hibernate3.LocalSessionFactoryBean - Closing Hibernate SessionFactory
14-12-30 15:25:52,810 INFO  org.hibernate.impl.SessionFactoryImpl - closing
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/] 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.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [job_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-2] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-3] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-4] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-5] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-6] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-7] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-8] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-9] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-10] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-11] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-12] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-13] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/] appears to have started a thread named [pool-1-thread-14] but has failed to stop it. This is very likely to create a memory leak.
Dec 30, 2014 3:25:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Dec 30, 2014 3:25:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Dec 30, 2014 3:25:53 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 30, 2014 3:25:53 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 30, 2014 3:25:53 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 30, 2014 3:25:53 PM org.apache.catalina.connector.MapperListener registerEngine
WARNING: Unknown default host: localhost
Dec 30, 2014 3:25:53 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 30, 2014 3:25:53 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/13  config=null
Dec 30, 2014 3:25:53 PM org.apache.catalina.connector.MapperListener registerEngine
WARNING: Unknown default host: localhost
Dec 30, 2014 3:25:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9402 ms


原因是Tomcat6.0.25以后的版本引入了内存泄露阻止机制,检测到jdbc在tomcat运行时进行注册,但是当tomcat停止时没有解除注册。

网上有3中解决方案:

1. 将jdbc驱动包拷贝至tomcat的lib下,由tomcat自己进行管理

2. 将tomcat的server.xml中,删除防止内存泄露监听这行:

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener">

3. 将tomcat换成6.0.25以前的版本。

我试过第2种方法,但是不管用结果还一样,最后是通过第3种方案解决的。所用tomcat版本是6.0.20,官网下载的。 http://archive.apache.org/dist/tomcat/
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
### 回答1: 这是一条警告信息,意思是在 Web 应用程序停止时,虽然已经注册了 JDBC 驱动程序 [oracle.jdbc.oracledriver],但未能注销它。为了防止内存泄漏,强制注销了 JDBC 驱动程序。 ### 回答2: 这段话的意思是,在 web 应用程序停止时,虽然已经成功地注册了 Oracle 数据库的 JDBC 驱动程序 [oracle.jdbc.oracledriver],但是在停止时未能成功注销该驱动程序,从而导致可能会导致内存泄漏的情况发生。为了避免这种情况的发生,系统将强制注销该 JDBC 驱动程序。 JDBC 驱动程序是一种连接数据库的工具,它可以让我们建立连接、发送 SQL 命令、获取和处理查询结果。在 web 应用程序中,我们通常会把 JDBC 驱动程序注册到应用程序中,以便我们在需要访问数据库时能够正常使用它。 然而,当 web 应用程序停止时,我们也需要注销已经注册的 JDBC 驱动程序,以便释放相关的资源,避免内存泄漏的情况发生。如果我们没有正确注销 JDBC 驱动程序,就有可能会造成系统资源的浪费,从而影响应用程序的性能和稳定性。 以上述情况为例,系统检测到在停止 web 应用程序时未能成功注销已经注册的 JDBC 驱动程序,因此就会强制注销该驱动程序,以避免内存泄漏的情况发生。这样做可以保证系统的稳定性和安全性,避免不必要的资源浪费,提高应用程序的性能。 ### 回答3: 该消息是在Web应用程序停止时由Tomcat服务器系统自动生成的警告消息。 JDBC是Java Database Connectivity的缩写,是Java程序用于在数据库中执行操作的API集合。当应用程序运行时,必须先将JDBC驱动程序注册到JVM的内存中,以便在需要连接到数据库时在应用程序和数据库之间建立通信。该警告消息指出,在注册了JDBC驱动程序以后,当web应用程序停止时未成功注销它,因而可能导致内存泄漏的风险。 内存泄漏是指有一个运行中的程序使用了系统的内存资源,但是在使用过程中并未正确释放资源,导致系统中的内存资源被无限制地占用,最终可能导致系统崩溃。在本例中,应用程序在注册JDBC驱动程序成功后,未正确地注销JDBC驱动程序,导致被占用的JVM内存越来越多,并可能在长时间运行的情况下导致内存不足,程序执行出现错误。 为了避免这种情况的发生,在web应用程序停止时,Tomcat服务器系统强制注销该JDBC驱动程序,以释放占用的系统内存资源。因此,如果您看到了这个消息,您应该检查您的应用程序代码,确保在应用程序运行期间,所有注册的JDBC驱动程序在应该注销它们的时候都进行了正确的注销。这是一个很小的问题,但是如果不及时处理,可能会导致应用程序的严重错误,影响到应用程序的稳定性和可靠性。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值