Tomcat周期性自动关闭,高分求解

黎某人 2014-09-04 05:35:07
我在服务器上部署了Tomcat8,使用的默认JAVA_OPTS参数,但是每隔一段时间大概几十分钟或1,2个小时,就自动挂了,以下是日志自动关闭前的日志,麻烦看看是怎么回事,或者说存在什么样的可能,内部测试程序,还没部署到线上,就几个访问量,处理的都是小数据。

04-Sep-2014 17:27:17.278 INFO [Thread-6] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-20000"]
04-Sep-2014 17:27:17.280 INFO [Thread-6] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
2014-09-04 17:27:17 [org.springframework.web.context.support.XmlWebApplicationContext] - <Closing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Thu Sep 04 17:14:49 CST 2014]; parent: Root WebApplicationContext>
2014-09-04 17:27:17 [org.springframework.web.context.support.XmlWebApplicationContext] - <Closing Root WebApplicationContext: startup date [Thu Sep 04 17:14:47 CST 2014]; root of context hierarchy>
2014-09-04 17:27:17 [com.alibaba.druid.pool.DruidDataSource] - <{dataSource-1} closed>
04-Sep-2014 17:27:17.331 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc 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.
04-Sep-2014 17:27:17.332 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc The web application [/] registered the JDBC driver [com.alibaba.druid.mock.MockDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
04-Sep-2014 17:27:17.332 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc The web application [/] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
04-Sep-2014 17:27:17.333 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [Memcached IO over {MemcachedConnection to 135be5bb1ee711e4.m.cnqdalicm9pub001.ocs.aliyuncs.com/10.157.212.8:11211}] but has failed to stop it. This is very likely to create a memory leak.

04-Sep-2014 17:27:17.334 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [ForkJoinPool.commonPool-worker-1] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.334 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "ForkJoinPool.commonPool-worker-1":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.ForkJoinPool.awaitWork(ForkJoinPool.java:1756)
java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1696)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1644)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
04-Sep-2014 17:27:17.335 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [transcoder-1-1] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.335 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "transcoder-1-1":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.336 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [pool-2-thread-1] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.336 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "pool-2-thread-1":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.337 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [pool-2-thread-2] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.337 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "pool-2-thread-2":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.339 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [pool-2-thread-3] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.340 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "pool-2-thread-3":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.340 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [pool-2-thread-4] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.344 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "pool-2-thread-4":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.345 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [pool-2-thread-5] but has failed to stop it. This is very likely to create a memory leak.
04-Sep-2014 17:27:17.345 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads Stack trace of thread "pool-2-thread-5":
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
04-Sep-2014 17:27:17.365 INFO [Thread-6] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-20000"]
04-Sep-2014 17:27:17.368 INFO [Thread-6] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-20000"]
...全文
7132 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
baidu_37847835 2017-03-10
  • 打赏
  • 举报
回复
机器掉电后,开机后起Tomcat遇到一次这个问题,应该是memcached的问题,清理掉tomcat work下内容,重启memcached,再启动tomcat 就OK了。
ranmannic 2016-03-12
  • 打赏
  • 举报
回复
问题最后怎么解决的?也遇到了通用的问题,求解
d12345b 2015-05-27
  • 打赏
  • 举报
回复
请问楼主的问题解决了吗,现在遇到了同样问题
海逸_2018 2014-09-05
  • 打赏
  • 举报
回复
1) 确认下你连的数据库连接数是否占满了 2)确认你程序访问的数据库表是否被锁了,或者行锁,如果是,你程序频繁访问的话可能服务会挂掉
huasuoworld 2014-09-05
  • 打赏
  • 举报
回复
Stack trace of thread xxx,你项目有没有用线程,都关闭了没?
晓风吹雾 2014-09-05
  • 打赏
  • 举报
回复
1 log 大部分信息都是问题发生以后的信息。不好做分析 2 log的等级设置为trace和debug,便于分析 3 写一个批处理 使用pstack实时监视 各个线程的状态。每隔1s打印状态。便于分析。 综上 准备工作 做的越详细,这样便于发现问题。
Magical茏 2014-09-05
  • 打赏
  • 举报
回复
错误信息 the web application was stopped. To prevent a memory leak, 默认情况下,如果一个连接8小时都没有使用,mysql将会自动将其关闭.项目中用的是SSH框架.hibernate 3.0不会自动检查mysql链接是否有效.故当8小时没人访问,mysql则链接失效,若再有人访问,由于数据库链接已失效,tomcat为防止内存溢出,则也自动关闭. 楼主说 每隔一段时间大概几十分钟或1,2个小时,就自动挂了 我猜测可能是mysql 的wait_timeout设置 的时间被修改过,变的更短了 楼主 SHOW VARIABLES LIKE 'interactive_timeout' 看看mysql 的interactive_timeout 是不是默认的28800
miracleliu 2014-09-05
  • 打赏
  • 举报
回复
看看连接池,是不是没关闭
niuzaiwenjie 2014-09-05
  • 打赏
  • 举报
回复
but has failed to stop it. This is very likely to create a memory leak 但未能阻止它。这是创建一个内存泄漏很可能
skgary 2014-09-05
  • 打赏
  • 举报
回复
我觉得在这个之前是不是还有其他的错误导致的? 比如说有什么OutOfMemroy之类的??
姜小白- 2014-09-04
  • 打赏
  • 举报
回复
黎某人 2014-09-04
  • 打赏
  • 举报
回复
引用 3 楼 magi1201 的回复:
org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc 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. 这个错误之前论坛上出现过,是频繁热部署导致的 楼主的tomcat是开发环境吗?还是单的tomcat在跑,然后过段时间自己挂掉的?
热部署倒是没有,tomcat启动后什么都不干 一会就这样了
姜小白- 2014-09-04
  • 打赏
  • 举报
回复
org.apache.catalina.loader.WebappClassLoader.clearReferencesJdbc 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. 这个错误之前论坛上出现过,是频繁热部署导致的 楼主的tomcat是开发环境吗?还是单的tomcat在跑,然后过段时间自己挂掉的?
黎某人 2014-09-04
  • 打赏
  • 举报
回复
引用 1 楼 whos2002110 的回复:
org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [Memcached IO over {MemcachedConnection to 135be5bb1ee711e4.m.cnqdalicm9pub001.ocs.aliyuncs.com/10.157.212.8:11211}] but has failed to stop it. This is very likely to create a memory leak. 查缓存的链接用了没关掉?
自带的连接池
whos2002110 2014-09-04
  • 打赏
  • 举报
回复
org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads The web application [/] appears to have started a thread named [Memcached IO over {MemcachedConnection to 135be5bb1ee711e4.m.cnqdalicm9pub001.ocs.aliyuncs.com/10.157.212.8:11211}] but has failed to stop it. This is very likely to create a memory leak. 查缓存的链接用了没关掉?

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧