java.io.IOException: Stream closed異常

來源:互聯網
上載者:User

2010-3-4 11:36:45 org.apache.catalina.core.ApplicationDispatcher invoke<br />嚴重: Servlet.service() for servlet jsp threw exception<br />java.io.IOException: Stream closed<br />at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204)<br />at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)<br />at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:188)<br />at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:118)<br />at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:77)<br />at org.apache.jsp.jsp.layout.systemmanage.content_jsp._jspService(content_jsp.java:163)<br />at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)<br />at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)<br />at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)<br />at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)<br />at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)<br />at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)<br />at com.webapp.struct.module.mapping.Mapping.mapping(Mapping.java:25)<br />at com.webapp.control.mapping.MappingProcess.execute(MappingProcess.java:19)<br />at com.webapp.main.WebApp.service(WebApp.java:105)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br />at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br />at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br />at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br />at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br />at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br />at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br />at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br />at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br />at java.lang.Thread.run(Thread.java:619)<br />org.apache.jasper.JasperException: java.lang.IllegalStateException: Exception occurred when flushing data<br />at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)<br />at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)<br />at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)<br />at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)<br />at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)<br />at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)<br />at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)<br />at com.webapp.struct.module.mapping.Mapping.mapping(Mapping.java:25)<br />at com.webapp.control.mapping.MappingProcess.execute(MappingProcess.java:19)<br />at com.webapp.main.WebApp.service(WebApp.java:105)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br />at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br />at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br />at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br />at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br />at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br />at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br />at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br />at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br />at java.lang.Thread.run(Thread.java:619)<br />Caused by: java.lang.IllegalStateException: Exception occurred when flushing data<br />at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)<br />at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:118)<br />at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:77)<br />at org.apache.jsp.jsp.layout.systemmanage.content_jsp._jspService(content_jsp.java:163)<br />at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)<br />... 25 more<br />Caused by: java.io.IOException: Stream closed<br />at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204)<br />at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)<br />at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:188)<br />... 31 more

 

找到的解決方案:

這個異常發生在從某一個input stream流讀取資訊的時候發生的。
這個異常是發生在這樣一種情境之下:

多個線程索引同一個input stream,當某一個thread在執行完之後,把這個inputstream關閉了;而此時正在從這個input stream流中讀取資訊的線程就會拋出 java.io.IOException: Stream closed 異常。

 

參考自:http://blog.zdnet.com.cn/html/84/289384-1075439.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.