Tomcat启动后报:IOException while loading persisted ses
Tomcat启动后报:IOException while loading persisted ses
程序猿小明 发表于3年前
Tomcat启动后报:IOException while loading persisted ses
  • 发表于 3年前
  • 阅读 9
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 技术升级10大核心产品年终让利>>>   

Tomcat启动后报: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(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:57)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:361)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)
    at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)
    at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)
    at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
- 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:57)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:361)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)
    at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)
    at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)
    at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)


产生此异常的原因是:tomcat在启动的时候要读取硬盘上session,读取失败后就会产生此异常。


解决方案:(1) 删除apache-tomcat-7.0.25\work\Catalina\localhost\项目名 下的session.ser文件 (推荐这种)

  (2) 删除apache-tomcat-7.0.25\work\Catalina\localhost 下所有的session.ser文件

共有 人打赏支持
粉丝 4
博文 38
码字总数 2932
×
程序猿小明
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: