Hi Dave,
this is the problem. I do have a session timeout set to 1min for testing
purposes. In every jsp page of my app I check if(session.getValue("user") ==
null) and if this is true(like when the session expires) I do a sendRedirect
to my login page. That's where I get the exception:

How can I solve this?
Thanks in advance. Ciao, Vittorio

Included servlet error: 500
Location: /newfeatures/stats.jsp
Internal Servlet Error:

javax.servlet.ServletException: Response has already been committed
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java, Compiled Code)
        at
_0002fheader_0002ejspheader_jsp_9._jspService(_0002fheader_0002ejspheader_js
p_9.java, Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(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.RequestDispatcherImpl.include(RequestDispatcherImpl.j
ava, Compiled Code)
        at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java,
Compiled Code)
        at
_0002fstats_0002ejspstats_jsp_6._jspService(_0002fstats_0002ejspstats_jsp_6.
java, Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(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)

Root cause:
java.lang.IllegalStateException: Response has already been committed
        at
org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon
seFacade.java, Compiled Code)
        at
org.apache.tomcat.core.HttpServletResponseFacade.sendRedirect(HttpServletRes
ponseFacade.java, Compiled Code)
        at
_0002fheader_0002ejspheader_jsp_9._jspService(_0002fheader_0002ejspheader_js
p_9.java, Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(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.RequestDispatcherImpl.include(RequestDispatcherImpl.j
ava, Compiled Code)
        at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java,
Compiled Code)
        at
_0002fstats_0002ejspstats_jsp_6._jspService(_0002fstats_0002ejspstats_jsp_6.
java, Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(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)


-----Original Message-----
From: Bolt, Dave [mailto:[EMAIL PROTECTED]]
Sent: lunedì 26 marzo 2001 17.45
To: [EMAIL PROTECTED]
Subject: Re: Response has already been committed


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

===========================================================================
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