tomcat重新加载项目时报异常

痴傻二呆萌 2014-08-05 11:52:17
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
警告: The web application [/base] 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.
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [MySQL Statement Cancellation Timer] 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.Object.wait(Object.java:502)
java.util.TimerThread.mainLoop(Timer.java:526)
java.util.TimerThread.run(Timer.java:505)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [__DEFAULT__] 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.util.TimerThread.mainLoop(Timer.java:552)
java.util.TimerThread.run(Timer.java:505)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [org%002ehibernate%002ecache%002e%0053tandard%0051uery%0043ache.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [Statistics Thread-__DEFAULT__-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [org%002ehibernate%002ecache%002e%0055pdate%0054imestamps%0043ache.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [com%002ebase%002eentity%002e%0055ser.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [com%002ebase%002eentity%002e%0052ole.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [org%002ehibernate%002ecache%002espi%002e%0055pdate%0054imestamps%0043ache.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
警告: The web application [/base] appears to have started a thread named [org%002ehibernate%002ecache%002einternal%002e%0053tandard%0051uery%0043ache.data] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
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)
八月 05, 2014 11:19:26 上午 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/base] created a ThreadLocal with key of type [net.sf.json.AbstractJSON.CycleSet] (value [net.sf.json.AbstractJSON$CycleSet@574fc56b]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1d63c98b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

以上为异常信息,这是什么原因导致的? 如何解决..谢谢搞了一上午了
...全文
467 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
S117 2014-08-05
  • 打赏
  • 举报
回复
看你的代码,哪里起线程了
wangqiao4j 2014-08-05
  • 打赏
  • 举报
回复
可以试试先清空tomcat缓存,然后重新启动试试。
痴傻二呆萌 2014-08-05
  • 打赏
  • 举报
回复
引用 2 楼 longtian1213 的回复:
看你的代码,哪里起线程了
public class EntityManagerHelper { private static final EntityManagerFactory emf; private static final ThreadLocal<EntityManager> threadLocal; private static final Logger logger; static { emf = Persistence.createEntityManagerFactory("myJPA"); threadLocal = new ThreadLocal<EntityManager>(); logger = Logger.getLogger("myJPA"); logger.setLevel(Level.ALL); } /** * 通过threadLocal 获得EntityManager 对象 * * @return EntityManager 对象 */ public static EntityManager getEntityManager() { EntityManager manager = threadLocal.get(); if (manager == null || !manager.isOpen()) { manager = emf.createEntityManager(); threadLocal.set(manager); } return manager; } /** * 关闭EntityManager对象 */ public static void closeEntityManager() { EntityManager em = threadLocal.get(); threadLocal.set(null); if (em != null && em.isOpen()) { em.close(); } } /** * 开启事物 */ public static void beginTransaction() { getEntityManager().getTransaction().begin(); } /** * 事务提交 */ public static void commit() { getEntityManager().getTransaction().commit(); } /** * 事务回滚 */ public static void rollback() { getEntityManager().getTransaction().rollback(); } /** * 获得Query对象 * @param query * @return */ public static Query createQuery(String query) { return getEntityManager().createQuery(query); } } 这是EntityManagerHelper的代码 这里使用了ThreadLocal
痴傻二呆萌 2014-08-05
  • 打赏
  • 举报
回复
引用 3 楼 huxiweng 的回复:
停了,重新启动。关闭的时候没有正常
停了之后,重新启动没问题.就是加载时有问题.是不是线程没关闭的事
痴傻二呆萌 2014-08-05
  • 打赏
  • 举报
回复
引用 1 楼 wangqiao4j 的回复:
可以试试先清空tomcat缓存,然后重新启动试试。
重新启动没问题
tony4geek 2014-08-05
  • 打赏
  • 举报
回复
上面是警告,运行有问题吗?
teemai 2014-08-05
  • 打赏
  • 举报
回复
停了,重新启动。关闭的时候没有正常

81,094

社区成员

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

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