Tomcat 6在上下文重新加载时失败

时间:2011-04-30 21:01:53

标签: java spring tomcat java-ee

有些日子我在tomcat重新加载上下文时遇到问题。在大多数情况下它可以工作,在某些情况下它会失败。我收到以下错误:

30.04.2011 22:52:16 org.apache.catalina.loader.WebappClassLoader modified
SCHWERWIEGEND:     Resource '/WEB-INF/classes/com/sample/ContextLoaderListener.class' is missing
30.04.2011 22:52:16 org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
30.04.2011 22:52:16 org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet 'application'
2011-04-30 22:52:16,456 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] 7780618 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (AbstractApplicationContext.java:1002) INFO   - Closing WebApplicationContext for namespace 'application-servlet': startup date [Sat Apr 30 20:42:35 CEST 2011]; parent: Root WebApplicationContext
2011-04-30 22:52:16,460 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] 7780622 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (DefaultSingletonBeanRegistry.java:422) INFO   - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6684b1e0: defining beans parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@7f6b321b
30.04.2011 22:52:16 org.apache.catalina.session.StandardManager doUnload
SCHWERWIEGEND: IOException while saving persisted sessions: java.io.FileNotFoundException: C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\Catalina\localhost\_\SESSIONS.ser (Das System kann den angegebenen Pfad nicht finden)
java.io.FileNotFoundException: C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\Catalina\localhost\_\SESSIONS.ser (Das System kann den angegebenen Pfad nicht finden)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
    at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:489)
    at org.apache.catalina.session.StandardManager$PrivilegedDoUnload.run(StandardManager.java:89)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:452)
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:667)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4611)
    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3222)
    at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:403)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1309)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:662)
30.04.2011 22:52:16 org.apache.catalina.session.StandardManager stop
SCHWERWIEGEND: Exception unloading sessions to persistent storage
java.io.FileNotFoundException: C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\Catalina\localhost\_\SESSIONS.ser (Das System kann den angegebenen Pfad nicht finden)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
    at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:489)
    at org.apache.catalina.session.StandardManager$PrivilegedDoUnload.run(StandardManager.java:89)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:452)
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:667)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4611)
    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3222)
    at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:403)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1309)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:662)

正如您所看到的,我编写了自己的ServletContextListener,这是tomcat找不到的。我正在使用Eclipse WST进行开发。

感谢任何有用的提示!

1 个答案:

答案 0 :(得分:5)

关闭Eclipse并删除

C:\dev\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\*

然后重试。如果这不起作用,也删除tmp3文件夹并重试。

我总是很难在Eclipse中使用Tomcat。对我来说,当我在不关闭Tomcat或Eclipse / Tomcat崩溃的情况下退出Eclipse时会发生类似这样的事情。