Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 6 fails on context reload

Since some days I am facing problems when my tomcat reloads the context. In most cases it works, in some cases it fails. I get the following error:

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)

As you can see I wrote my own ServletContextListener which is not found by tomcat. I am using Eclipse WST for development.

Thanks for any useful hint!

like image 244
Erik Avatar asked Apr 30 '11 21:04

Erik


1 Answers

Shutdown Eclipse and delete

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

and retry. If this doesnt work, delete tmp3 folder as well and retry.

I've always had a hard time using Tomcat from within Eclipse. For me something like this happens when I exit Eclipse without shutting down Tomcat, or Eclipse/Tomcat crashes.

like image 82
lobster1234 Avatar answered Oct 20 '22 20:10

lobster1234