IOException while loading persisted sessions: java.io.EOFException 异常解决办法:

在前面几次启动测试项目的时候都正常。经过几次对代码的修改,来回反复的关闭启动Tomcat,突然跳出了一大堆的异常信息。具体的异常信息如下:

严重: IOException while loading persisted sessions: java.io.EOFException
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
	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:363)
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:322)
	at org.apache.catalina.session.StandardManager.start(StandardManager.java:649)
	at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:446)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4631)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	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:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-2-23 13:54:55 org.apache.catalina.session.StandardManager start
严重: Exception loading sessions from persistent storage
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
	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:363)
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:322)
	at org.apache.catalina.session.StandardManager.start(StandardManager.java:649)
	at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:446)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4631)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	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:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

严重: IOException while loading persisted sessions: java.io.EOFException
严重: Exception loading sessions from persistent storage

经过百度一通,找到是因为tomcat对硬盘的session读取失败,彻底解决办法一下:将work下面的文件清空或者只是删除掉session.ser即可以解决此异常。

标签: IOException while loading persisted sessions: java.io.EOFException 异常, Java异常

添加新评论