JAVA ·

启动Tomcat 异常 严重: Exception loading sessions from

Tomcat部署项目启动的时候,提示异常


严重: IOException while loading persisted sessions: java.io.EOFException
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2325)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2794)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
	at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:95)
	at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:223)
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:176)
	at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5643)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

一月 22, 2018 12:20:36 下午 org.apache.catalina.session.StandardManager startInternal
严重: Exception loading sessions from persistent storage
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2325)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2794)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
	at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:95)
	at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:223)
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:176)
	at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5643)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

主要看这两句即可:

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

错误原因

错误的原因是在EOFException的发生了意外,有可能是上次不正常关闭等原因导致的;

有一些活动session被持久化(一些临时文件),在重启时Tomcat的时候,Tomcat尝试去恢复这些session的持久化数据但又读取失败造成的异常错误;

我自身原因有可能是我在跑两个项目,都是用的Tomcat,轮流在停止运行很多次问题导致的异常。

虽然不影响程序运行,但我们还是解决掉。

解决方法

在Tomcat 目录下 work\Catalina\localhost 的文件夹

删除项目下的*.ser文件即可,或者只删除session.ser文件也行(主要原因就是session导致的)。

如果不知道哪个项目出的错,可直接删除Catalina目录也行的。

 

参与评论

  • 橘子书

    DALAO,666。我都看不懂是什么意思。

    1年前 (2018-01-22)
    回复
    回复橘子书
  • 晓庄

    尴尬,还需继续努力

    1年前 (2018-01-22)
    回复
    回复晓庄