java.lang.IllegalStateException: Response has already been committed

I am hosting two web applications on a Tomcat Server.

The first application uses servlet classes and is working fine.

The second application uses java beans for inout processing. When I entered the input on a JSP page and submit it to the bean, it is showing up the

"java.lang.IllegalStateException: Response has already been committed " error.

The exact error is :

Error: 500

Location: /testing/userinit.jsp

Internal Servlet Error:

java.lang.IllegalStateException: Response has already been committed

at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157)

at org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299)

at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)

at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)

at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)

at java.lang.Thread.run(Unknown Source)

Could someone help me figure out the issue?

Thank you.

[1376 byte] By [sivakovvuria] at [2007-11-27 6:21:55]
# 1

The "response has been committed" error is probably hiding another error.

Check your logs before this error to see the real cause.

Tomcat starts writing the html response to a buffer.

If an exception/error is encountered, it tries to cancel the response to date, and send an "error" response.

In the case where the response is already committed (buffer has been filled up, or manually flushed/committed) then it creates this IllegalStateException.

Suggestions to find the real problem

1 - Increase the buffer size of the page <%@ page buffer="64kb" %> to see if it will then show you the 'correct' error message

2 - Comment out all the stuff in your JSP page, and then uncomment things until the page 'breaks'. That will help you isolate which line of code is creating the problem

Hope this helps

evnafets

evnafetsa at 2007-7-12 17:38:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
you can also get this error if you try to perform two forwards from the same resource for example. Be sure to put a return statement after each forward or redirect you do.
gimbal2a at 2007-7-12 17:38:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...