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