tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35156] New: - Stream closed exception
Date Wed, 01 Jun 2005 12:25:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35156>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35156

           Summary: Stream closed exception
           Product: Tomcat 5
           Version: 5.0.12
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Keywords: ErrorMessage
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: york@perm.dataart.com


Sorry for my bad English.

Sources:
1. $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/
runtime/PageContextImpl.java,v 1.52 2003/09/02 21:39:59 remm Exp $
   $Revision: 1.52 $
   $Date: 2003/09/02 21:39:59 $
2. $Header: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/
catalina/core/ApplicationDispatcher.java,v 1.26 2003/09/12 17:04:12 remm Exp $
   $Revision: 1.26 $
   $Date: 2003/09/12 17:04:12 $


Steps To Reproduce:
1. Create four JSP:
---------------------------------------------------------
------------------------- 1.jsp -------------------------
<%@ page import="java.util.Vector"%>
<%@ page errorPage="error.jsp" %>
<%@ taglib prefix="logic" uri="/WEB-INF/tlds/struts-logic.tld" %>

CONTENT PAGE 1

<%
  // SOME COLLECTION
  Vector someCollection1 = new Vector(1);
  someCollection1.add("some value");
%>

<%-- Some EVAL_BODY_BUFFERED tag --%>
<logic:iterate id="some_id_1" collection="<%= someCollection1 %>" >
  <jsp:include page="2.jsp" />
</logic:iterate>

CONTENT PAGE 1

---------------------------------------------------------
------------------------- 2.jsp -------------------------
<%@ page import="java.util.Vector"%>
<%@ page errorPage="error.jsp" %>
<%@ taglib prefix="logic" uri="/WEB-INF/tlds/struts-logic.tld" %>

CONTENT PAGE 2
<%
  Vector someCollection2 = new Vector(1);
  someCollection2.add("some value");
%>

<%-- Some EVAL_BODY_BUFFERED tag --%>
<logic:iterate id="some_id_2" collection="<%= someCollection2 %>" ><%
  // Some throwable statment
  if(request.getParameter("not exist parameter") == null)
    throw new Exception();
%></logic:iterate>

CONTENT PAGE 2

---------------------------------------------------------
------------------------- 3.jsp -------------------------
<%@ page import="java.util.Vector"%>
<%@ taglib prefix="logic" uri="/WEB-INF/tlds/struts-logic.tld" %>

<%
  Vector someCollection3 = new Vector(1);
  someCollection3.add("some value");
%>

<%-- Some EVAL_BODY_BUFFERED tag --%>
<logic:iterate id="some_id_3" collection="<%= someCollection3 %>" >
  CONTENT PAGE 3
</logic:iterate>

---------------------------------------------------------
----------------------- error.jsp -----------------------
<%@ page import="java.io.PrintWriter"%>
<%@ page isErrorPage="true" %>

<pre>
<%
  PrintWriter pw;
  pw = new PrintWriter(out);
  Exception exc;
  exc = pageContext.getException();
  if(exc != null)
    exc.printStackTrace(pw);
%>
</pre>
---------------------------------------------------------

2. Deploy application.
3. Open 1.jsp. We receive a IOException instead of Exception from 2.jsp.
3. Open 3.jsp. We receive a IOException though should not receive exception.

WHY:
When thrown wxceptoin on 2.jsp into ApplicationDispatcher in 465 line was closes 
writer. Stack trace:
org.apache.jasper.catalina.core.ApplicationDispatcher.doForward():465
org.apache.jasper.catalina.core.ApplicationDispatcher.forward():359
org.apache.jasper.runtime.PageContextImpl.forward():543
org.apache.jasper.runtime.PageContextImpl.handlePageException():633
org.apache.jsp._2_jsp._jspService(): if (pageContext != null) pageContext.
handlePageException(t);

Later at use EVAL_BODY_BUFFERED tags called method pushBody, which returns 
closed writer. This is reason of IOExceptions.
Closed writer - is outs[depth] from PageContextImpl.
Possible, condition into PageContextImpl.pushBody in line 557 must be:
if (depth >= outs.length || IS_CLOSED(outs[depth])),
instead of
if (depth >= outs.length).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message