【解决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
    评论
12-Jul-2023 18:36:28.896 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 12-Jul-2023 18:36:28.898 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/setting] startup failed due to previous errors 2023-07-12 18:36:28,899 [// - - ] INFO org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Wed Jul 12 18:36:27 CST 2023]; root of context hierarchy 2023-07-12 18:36:28,900 [// - - ] INFO org.springframework.cache.ehcache.EhCacheManagerFactoryBean - Shutting down EhCache CacheManager 12-Jul-2023 18:36:28.908 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [setting] 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. 12-Jul-2023 18:36:28.908 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [setting] 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. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143) com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:40)
07-13
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值