File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes EOFException: Exception loading sessions from persistent storage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "EOFException: Exception loading sessions from persistent storage" Watch "EOFException: Exception loading sessions from persistent storage" New topic
Author

EOFException: Exception loading sessions from persistent storage

Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Hey guys,

I'm getting the following error and I don't know what is causing it. I had a perfectly working web application. After making javascript code changes, I restarted the server and started getting this error:

Apr 27, 2008 7:57:19 PM org.apache.catalina.session.StandardManager start
SEVERE: Exception loading sessions from persistent storage
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2279)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2748)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:58)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:362)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:321)
at org.apache.catalina.session.StandardManager.start(StandardManager.java:637)
at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:438)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4258)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Nina,

You should be able to delete ${catalina.home}/work/Catalina/localhost/appName/SESSION.ser where appName is your application (or just delete the whole work directory).

This should enable you to restart.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Stevi...ur the beST!!! I deleted the directory and it works now!!!
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

This solution does work but for a better understanding for myself why does this fix the issue and what causes this issue?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

Justin Rundle wrote:This solution does work but for a better understanding for myself why does this fix the issue and what causes this issue?


Apparently some of the saved session files were damaged somehow, possibly tomcat crached while writing them, possibly hardware problems. Since session files are not critical resources, the best solution was just to get rid of them.

Note that when I say "not critical resources", I mean that if you delete them while Tomcat isn't running, the user session will have been terminated when Tomcat restarts, so the user will effectively have been logged off and lost work in progress. They're DEFINITELY critical while Tomcat is running!


Customer surveys are for companies who didn't pay proper attention to begin with.
Justin Rundle
Ranch Hand

Joined: Mar 26, 2008
Posts: 123

Thanks for the reply.
Jackson Tan
Greenhorn

Joined: Jun 01, 2010
Posts: 8
Tim Holloway wrote:
Justin Rundle wrote:This solution does work but for a better understanding for myself why does this fix the issue and what causes this issue?


Apparently some of the saved session files were damaged somehow, possibly tomcat crached while writing them, possibly hardware problems. Since session files are not critical resources, the best solution was just to get rid of them.

Note that when I say "not critical resources", I mean that if you delete them while Tomcat isn't running, the user session will have been terminated when Tomcat restarts, so the user will effectively have been logged off and lost work in progress. They're DEFINITELY critical while Tomcat is running!


May I know any other cause of a corruption of saved session files? Can it be caused by the application code? please site some example for better understanding. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EOFException: Exception loading sessions from persistent storage