tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Is there Patch for 4.1 PageContextImpl unhandled IllegalStateException?
Date Mon, 30 May 2005 19:35:20 GMT
Hello Tomcat Users and Committers,Platform: Tomcat 4.1, Linux ES 2.1, jdk1.4.1.06Here is a
snippet of the stack trace we regularly in our Tomcat 4.1.24 logs.----- Root Cause -----java.lang.IllegalStateException:
getOutputStream() has already been called for this response        at org.apache.catalina.connector.ResponseBase.getWriter(
       at org.apache.catalina.connector.ResponseFacade.getWriter(
       at org.apache.jasper.runtime.JspWriterImpl.initOut(        at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(        at org.apache.jasper.runtime.PageContextImpl.release(
       at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(
       at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(
       at org.apache.jsp.ViewAttachment_jsp._jspService(      
 at org.apache.jasper.runtime.HttpJspBase.service(        at javax.servlet.http.HttpServlet.service(
       at org.apache.jasper.servlet.JspServletWrapper.service(
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(       
at org.apache.jasper.servlet.JspServlet.service(        at javax.servlet.http.HttpServlet.service(
       at org.apache.catalina.core.ApplicationDispatcher.invoke(
       at org.apache.catalina.core.ApplicationDispatcher.doForward(
       at org.apache.catalina.core.ApplicationDispatcher.forward(
intend to migrate to Tomcat 5.x later this year.  In the interim, we recently linked this
exception event to leaked memory.  That is, the PageContextImpl.release() method (6th from
top in stack trace, body below) never completes as it does not catch the IllegalStateException
that happens when ResponseBase.getWriter()is called in the scope of flushBuffer().      public
void release() {        out = baseOut;	try {	    if (isIncluded) {		((JspWriterImpl)out).flushBuffer();
               // push it into the including jspWriter	    } else {                // Do not
flush the buffer even if we're not included (i.e.                // we are the main page.
The servlet will flush it and close                // the stream.                ((JspWriterImpl)out).flushBuffer();
           }	} catch (IOException ex) {	    loghelper.log("Internal error flushing the buffer
in release()");	}	servlet      = null;	config	     = null;	context	     = null;	needsSession
= false;	errorPageURL = null;	bufferSize   = JspWriter.DEFAULT_BUFFER;	autoFlush    = true;
request      = null;	response     = null;        depth = -1;	baseOut.recycle();	session  
   = null;	attributes.clear();    }The tear-down activity session=null is skipped because
of the exception, which creates a problem since the session so referenced becomes ineligible
for garbage collection after processing the request.Does anyone know:a) is this documented
somewhere (I read 102 matches for ‘memory leak’ on the Tomcat 4.1 list archives, but I
did not find this exact problem, except for an entry in the 4.1 release notes where it is
reported fixed in 4.1.20).b) is there a patch available to fix this in Tomcat 4.x?Thanks very
much for your time,
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message