tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Date Thu, 23 Sep 2010 19:51:17 GMT
On 23/09/2010 12:01, Brian wrote:
> Thanks for the "commited" explanation, but I still have a doubt: Where in my
> code do I commit? I don't do it explicitly, so it is happening at some point
> automatically but I don't know exactly where/when. If a full buffer is not
> the cause, what is it for the commit to happen? In which method/class does
> it happen?

As soon as the buffer is full or you flush the response.

> I will raise the 8K capacity in the buffer, just in case that is the
> problem. That would explain why this problem appears to be "randomic". If
> just some pages are too big, that would make the buffer to be full, and then
> everything in the sequence you described would happen.
> 
> I don't explicitly disable the session creation in my JSPs, so that is not
> the problem. I don't call any "flushing" method either.

You need to explicitly disable session generation in your error JSP.
That will ensure the sequence never happens.

> It is clear that something goes wrong in my "ProductsForModel.jps" page
> (actually, in the java code generated for it), so an Exception is being
> thrown and " PageContextImpl.handlePageException()" takes care of it. But
> what exception? Is it the " java.lang.IllegalStateException: Cannot create a
> session after the response has been committed"? Or is it another one?

Yep, the broken error JSP is hiding the exception. Another option is to
remove the error handling JSPs.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message