假如tomcat啟動時報如下錯誤:
[ERROR,ManagerBase,main] IOException while loading persisted sessions: java.io.EOFException
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2155)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2621)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:734)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:251)
at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:56)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:384)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:343)
at org.apache.catalina.session.StandardManager.start(StandardManager.java:657)
at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:499)
at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:317)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:638)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4270)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
只要刪除tomcat下\work\Catalina\localhost\下對應項目中的SESSIONS.ser,然後重新啟動即可。