Marino,

I've been struggling with the same error - sometimes it occurs in a
non-predictable way.  Generally, it occurs when you try to write to the
Writer having already "committed" the response object (either explicitly by
calling certain response object methods (see below), or implicitly by
writing enough data to the response object to fill the buffer - thus causing
it to flush to the client).

What is the "root cause" error report?

The J2EE API states the following regarding certain response methods:

flushBuffer
public void flushBuffer() throws java.io.IOException
Forces any content in the buffer to be written to the client. A call to this
method automatically commits the response, meaning the status code and
headers will be written.

isCommitted
public boolean isCommitted()
Returns a boolean indicating if the response has been committed. A commited
response has already had its status code and headers written.
Returns:
a boolean indicating if the response has been committed

----------------------------------------------------------------------------
----

reset
public void reset()
Clears any data that exists in the buffer as well as the status code and
headers. If the response has been committed, this method throws an
IllegalStateException.
Throws:
java.lang.IllegalStateException - if the response has already been committed
----------------------------------------------------------------------------
----


Tim Hengst
Tampa, FL

-----Original Message-----
From: Marino Vittorio [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 10:28 AM
To: [EMAIL PROTECTED]
Subject: Response has already been committed


I can never figure out why I get this:

java.lang.IllegalStateException: Response has already been committed
        at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon
seFacade.java, Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java,
Compiled Code)
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java, Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)


Any hint?
Thanks, Vittorio

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to