关于org.apache.catalina.session.StandardManager doLoad错误的解决

2009-7-28 14:46:11 org.apache.catalina.session.StandardManager doLoad在开发项目的时候,偶尔遇到了如下问题,在启动tomcat时抛出下列异常

严重: IOException while loading persisted sessions: java.io.EOFException

java.io.EOFException

atjava.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2232)

atjava.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)

atjava.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750)

atjava.io.ObjectInputStream.<init>(ObjectInputStream.java:268)

atorg.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:58)

atorg.apache.catalina.session.StandardManager.doLoad(StandardManager.java:362)

atorg.apache.catalina.session.StandardManager.load(StandardManager.java:321)

atorg.apache.catalina.session.StandardManager.start(StandardManager.java:637)

atorg.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:432)

atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4160)

atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)

atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)

atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)

atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)

atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)

atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)

atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)

atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)

atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)

atorg.apache.catalina.core.StandardHost.start(StandardHost.java:736)

atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)

atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

atorg.apache.catalina.core.StandardService.start(StandardService.java:448)

atorg.apache.catalina.core.StandardServer.start(StandardServer.java:700)

atorg.apache.catalina.startup.Catalina.start(Catalina.java:552)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

atjava.lang.reflect.Method.invoke(Method.java:585)

atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)

atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

2009-7-2814:46:11org.apache.catalina.session.StandardManagerstart

严重:Exceptionloadingsessionsfrompersistentstorage

java.io.EOFException

atjava.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2232)

atjava.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)

atjava.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750)

atjava.io.ObjectInputStream.<init>(ObjectInputStream.java:268)

atorg.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:58)

atorg.apache.catalina.session.StandardManager.doLoad(StandardManager.java:362)

atorg.apache.catalina.session.StandardManager.load(StandardManager.java:321)

atorg.apache.catalina.session.StandardManager.start(StandardManager.java:637)

atorg.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:432)

atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4160)

atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)

atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)

atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)

atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)

atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)

atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)

atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)

atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)

atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)

atorg.apache.catalina.core.StandardHost.start(StandardHost.java:736)

atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)

atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

atorg.apache.catalina.core.StandardService.start(StandardService.java:448)

atorg.apache.catalina.core.StandardServer.start(StandardServer.java:700)

atorg.apache.catalina.startup.Catalina.start(Catalina.java:552)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

atjava.lang.reflect.Method.invoke(Method.java:585)

atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)

atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

2009-7-28 14:46:32 org.apache.coyote.http11.Http11BaseProtocol start

该异常是由于关闭服务器时tomcat上次关闭时还有一些活动连接,Session未超时,将Session保存在磁盘上,在启动时又重新加载,所以在重启时tomcat尝试去恢复这些session造成的

解决方法:tomcat的work目录下面的东西删一遍。

相关推荐