tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian" <>
Subject RE: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Date Fri, 24 Sep 2010 00:45:33 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.

OK, thanks. I will increase the buffer to 16k, maybe then to 32K, and so on
until I see that the problem is gone.

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

Now that is an very interesting idea! I didn't think of that (as if I
thought about everything else, he he).
I will add a directive so that error page won't use sessions. Then I will
compare the container-generated java code to the one using sessions, to see
what am I missing. I guess I'm not missing anything, unless I use the
session in my code in that page.

> > 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
> has been committed"? Or is it another one?
> Yep, the broken error JSP is hiding the exception. Another option is to
> the error handling JSPs.

But If I remove the JSP than handles the errors (I mean, if I take out the
directive that declares that page in the other pages), how will I know if
something goes wrong in my pages? Correct me if I'm wrong, but I think that
only the user will see the error in his browser, but the log will not be
populated with the information of what went wrong.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message