I use Eclipse Kepler to develop a Sprig/Hibernate/PostgreSQL-based application. The application is run in Tomcat which is managed by Eclipse. This works fine generally.
After modifying and saving any jsp about 10 times I get the following exception:
Jan 17, 2014 9:53:33 AM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/app] has started Jan 17, 2014 9:53:33 AM org.apache.catalina.core.ApplicationContext log INFO: Destroying Spring FrameworkServlet 'dispatcherServlet' Jan 17, 2014 9:53:33 AM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext [DEBUG] [ContainerBackgroundProcessor[StandardEngine[Catalina]] 17.01.14 09:53:33] (Utils.java:logSystemState:365) System Info: active sessions: 1, availableProcessors: 8, maxMemory: 1754 MB, totalMemory: 658 MB, freeMemory: 110 MB, loadAverage: 0.11 [DEBUG] [ContainerBackgroundProcessor[StandardEngine[Catalina]] 17.01.14 09:53:33] (LifeCycle.java:destroy:89) APP 1.1.4 (built on Fri, 17.01.2014, 09:55), destroyed at /app, running on target environment 'dev'. Uptime: 1 hour, 4 minutes, 7 seconds and 314 milliseconds. Spring: 3.2.6.RELEASE, Hibernate: 4.2.8.Final Jan 17, 2014 9:53:33 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/app] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Jan 17, 2014 9:53:36 AM org.apache.catalina.core.ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath Jan 17, 2014 9:53:36 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext ... Jan 17, 2014 9:53:37 AM org.apache.catalina.session.StandardManager startInternal SEVERE: Exception loading sessions from persistent storage java.lang.ClassNotFoundException: com.mycompany.app.spring.AuthenticationWrapper at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:76) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1595) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1060) at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284) at org.apache.catalina.session.StandardManager.load(StandardManager.java:204) at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954) at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519) at java.lang.Thread.run(Thread.java:724) Jan 17, 2014 9:53:37 AM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/app] startup failed due to previous errors Jan 17, 2014 9:53:37 AM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Jan 17, 2014 9:53:37 AM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/app] is completed
The only solution to this is to stop Tomcat, do Project->Clean
, and restart Tomcat. Of course the session is lost and I have to log into the application again.
This problem is seriously affecting my development workflow, and so far I did not find a solution.
Suspecting a filesystem issue, I have tried to create a folder in tmpfs and used it as server path for Tomcat (setting in Eclipse), but it did not change anything.
Note that this is only happening on my laptop (Kubuntu 13.10) A colleague has the same laptop with the same OS and does not see the problem.
It seems the problem is that the session is getting corrupted on the filesystem and Tomcat chokes on that. Why is it happening ?