錯誤狀態如下
Exception Processing ErrorPage[errorCode=404, location=/404.jsp]<br />ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error<br /> at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:327)<br /> at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293)<br /> at org.apache.catalina.connector.Response.flushBuffer(Response.java:544)<br /> at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:286)<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br /> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)<br /> at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)<br /> at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br /> at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)<br /> at java.lang.Thread.run(Thread.java:595)<br />Caused by: java.net.SocketException: Connection reset by peer: socket write error<br /> at java.net.SocketOutputStream.socketWrite0(Native Method)<br /> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)<br /> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)<br /> at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:746)<br /> at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433)<br /> at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:304)<br /> at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:991)<br /> at org.apache.coyote.Response.action(Response.java:182)<br /> at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:322)<br /> 13 more
一般是在設定過
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
系統自動轉向頁面會造成不斷重複的這個異常拋出
解決方案:
修改error.jsp代碼
error.jsp 使用 response.sendRedirect("/index.html");
主要問題是IE7沒有正常解析應用伺服器給的跳轉資訊,需要我們自己寫代碼顯示地由伺服器重新導向到新的頁面 (jsp)
樣本代碼如下:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%><br /><%@ page import="org.apache.commons.logging.*" %><br /><html><br /><body><br /><%<br />Log log = LogFactory.getLog("error.jsp");<br />log.error("error.jsp 調用 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!-----------------------------");<br />response.sendRedirect("/index.html");<br />%><br /></body><br /></html>
再運行,問題解決