IOException while loading persisted sessions: java.io.EOFException

......
严重: IOException while loading persisted sessions: java.io.EOFException
java.io.EOFException
 at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
 at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
 at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
 at java.io.ObjectInputStream.<init>(Unknown Source)
 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:4271)
 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.deployDirectory(HostConfig.java:924)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
 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:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2010-1-19 9:35:16 org.apache.catalina.session.StandardManager start
严重: Exception loading sessions from persistent storage
java.io.EOFException
 at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
 at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
 at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
 at java.io.ObjectInputStream.<init>(Unknown Source)
 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:4271)
 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.deployDirectory(HostConfig.java:924)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
 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:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 INFO [main] (ProxoolFacade.java:86) - Proxool 0.9.0RC3 (10-Jan-2007 01:38)
2010-1-19 9:35:27 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-1-19 9:35:27 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2010-1-19 9:35:27 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47  config=null
2010-1-19 9:35:27 org.apache.catalina.startup.Catalina start
信息: Server startup in 12142 ms


    分析:EOFException表示输入过程中意外地到达文件尾或流尾的信号,导致从session中获取数据失败。异常是tomcat本身的问题,由于tomcat上次非正常关闭时有一些活动session被持久化(表现为一些临时文件),在重启时,tomcat尝试去恢复这些session的持久化数据但又读取失败造成的。此异常不影响系统的使用。

        解决办法:在tomcat6.0\work\Catalina\localhost下搜索“.ser”,删除这个文件。如果正常关闭服务端,该文件是自动删除的。

        我参照上面方法解决的问题,用的是MyEclipse7.0,tomcat6.0。通常情况下,会认为是tomcat的缓存,会直接把整个localhost文件夹删除。但是上面的方法也是可取的,在localhost文件夹下,找到部署的工程名,在该工程名下有SESSIONS.ser文件,直接删除。重启tomcat,问题解决。

或者:
   (tomcat_home)\work\Catalina\localhost\tldCache.ser,有可能是SESSION.ser,删除这个文件就行

你可能感兴趣的:(java,apache,tomcat,活动,sun)