Often this happens because you are attempting to forward a user to another
page or an error has occured and Tomcat is attempting to send the user to
your web apps error page and content has already been sent to the user. This
can also happen when you try to set various headers in the response object
(mime type, length, etc.) and content has already been sent to the user.
Most JSP engines, including Tomcat, use a buffer that temporarily holds
information to be sent back to the user, as long as the buffer has not been
flushed (i.e. sent to the user's browser), you can do stuff like
<jsp:forward>, etc. Once the buffer has been flushed at least once, any
attempt to forward the user, set HTTP headers, etc. will cause the app to
get this exception. The buffer is something like 4K or 8K in size.
Double check the content on your page, you are probably getting an exception
which is causing a forward to your error page, but the buffer has already
flushed. Check the log files carefully, you might have an earlier exception
that is being masked by the IllegalStateException. Many of the books on JSPs
and servlets also cover this issue, so you might visit your local bookstore
to scan for help on this issue.
Good luck
Dave
-----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