Exception Processing ErrorPage[errorCode=404 ClientAbortException: java.net.SocketException: Connec

來源:互聯網
上載者:User

錯誤狀態如下

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>

再運行,問題解決

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.