<div class="htmledit_views">html
<p></p><pre onclick="hljs.copyCode(event)"><code class="language-java hljs"><ol class="hljs-ln"><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="1"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">錯誤代碼以下:</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="2"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">嚴重: IOException <span class="hljs-keyword">while</span> loading persisted sessions: java.io.EOFException</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="3"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">java.io.EOFException</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="4"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:<span class="hljs-number">2325</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="5"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:<span class="hljs-number">2794</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="6"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:<span class="hljs-number">801</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="7"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:<span class="hljs-number">299</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="8"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:<span class="hljs-number">58</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="9"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:<span class="hljs-number">226</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="10"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.load(StandardManager.java:<span class="hljs-number">183</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="11"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:<span class="hljs-number">473</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="12"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:<span class="hljs-number">150</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="13"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:<span class="hljs-number">5293</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="14"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:<span class="hljs-number">150</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="15"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:<span class="hljs-number">726</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="16"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:<span class="hljs-number">702</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="17"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:<span class="hljs-number">698</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="18"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:<span class="hljs-number">1119</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="19"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:<span class="hljs-number">1760</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="20"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:<span class="hljs-number">471</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="21"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.FutureTask.run(FutureTask.java:<span class="hljs-number">262</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="22"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:<span class="hljs-number">1145</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="23"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:<span class="hljs-number">615</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="24"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.lang.Thread.run(Thread.java:<span class="hljs-number">744</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="25"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">一月 <span class="hljs-number">02</span>, <span class="hljs-number">2014</span> <span class="hljs-number">2</span>:<span class="hljs-number">38</span>:<span class="hljs-number">27</span> 下午 org.apache.catalina.session.StandardManager startInternal</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="26"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">嚴重: Exception loading sessions from persistent storage</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="27"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">java.io.EOFException</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="28"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:<span class="hljs-number">2325</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="29"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:<span class="hljs-number">2794</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="30"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:<span class="hljs-number">801</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="31"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:<span class="hljs-number">299</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="32"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:<span class="hljs-number">58</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="33"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:<span class="hljs-number">226</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="34"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.load(StandardManager.java:<span class="hljs-number">183</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="35"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:<span class="hljs-number">473</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="36"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:<span class="hljs-number">150</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="37"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:<span class="hljs-number">5293</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="38"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:<span class="hljs-number">150</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="39"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:<span class="hljs-number">726</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="40"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:<span class="hljs-number">702</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="41"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:<span class="hljs-number">698</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="42"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:<span class="hljs-number">1119</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="43"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:<span class="hljs-number">1760</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="44"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:<span class="hljs-number">471</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="45"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.FutureTask.run(FutureTask.java:<span class="hljs-number">262</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="46"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:<span class="hljs-number">1145</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="47"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:<span class="hljs-number">615</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="48"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line"> at java.lang.Thread.run(Thread.java:<span class="hljs-number">744</span>)</div></div></li><li><div class="hljs-ln-numbers"><div class="hljs-ln-line hljs-ln-n" data-line-number="49"></div></div><div class="hljs-ln-code"><div class="hljs-ln-line">一月 <span class="hljs-number">02</span>, <span class="hljs-number">2014</span> <span class="hljs-number">2</span>:<span class="hljs-number">38</span>:<span class="hljs-number">27</span> 下午 org.apache.catalina.startup.HostConfig deployDirectory</div></div></li></ol></code><div class="hljs-button" data-title="複製"></div></pre><br> 錯誤的緣由是:EOFException表示輸入過程當中意外地到達文件尾或流尾的信號,致使從session中獲取數據失敗。這是因爲tomcat上次非正常關閉時有一些活動session被持久化(表現爲一些臨時文件),在重啓時,tomcat嘗試去恢復這些session的持久化數據但又讀取失敗形成的。此異常不影響系統的使用。 <p><img src="https://img-blog.csdn.net/20140102144834015?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcmVkYXJteV9jaGVu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p> <p>能夠看到,我正在使用的day56項目中多了一個sessions.ser文件,把此文件刪除便可tomcat便可正常的使用.</p> <p><br></p> <p>若是你的項目中不知道是哪一個項目引發的.就把Catalina目錄下的全部文件刪除,便可.</p> <p><br></p> <p><br></p> </div>java