tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Tomcat IllegalStateException when load is high
Date Fri, 05 Feb 2010 16:04:33 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alex,

On 2/5/2010 3:24 AM, alex_m wrote:
> I'm having a problem when running a JSP/Struts application on tomcat 5.5-25
> and Java 1.6_10.
> 
> When the load gets high on Java process i get an error:
> 
> at java.lang.IllegalStateException: Cannot create a session after the
> response has been committed

[snip]

> I get the error every now and then on a jsp-page and it seems like it occurs
> when the java-process has high CPU-%.
> 
> Any clues on what to do?

There have been a bunch of session-related fixes since 5.5.25 that may
be affecting you. Try searching
http://tomcat.apache.org/tomcat-5.5-doc/changelog.html for "session"
until you get back to 5.5.25 and you can see which issues were fixed in
each release.

Is it possible for you to upgrade to 5.5.28?

Also, that IllegalStateException looks more like a problem with the JSP
(that is, creating a session too late) than the rest of the server. It
looks like this is happening in a JSP called unhandledException.jsp,
which presumably if an error handler. If the servlet/JSP that was
running prior to the exception being thrown didn't require a session,
it's possible that none was ever created. If the servlet/JSP emitted
enough output back to the client that the output buffer was filled and
flushed, then the response is "committed" which means that all headers
have gone to the client and you can't add more.

When the exception occurs, your unhandledException.jsp tries to create a
session, which requires a header to be added to the response, which
fails because the headers are long gone.

If this sounds plausible, check to see if you really need session access
in unhandledException.jsp. IF not, simply add session="false" to your
<%@page> header in the JSP and it might fix everything up.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktsQZEACgkQ9CaO5/Lv0PD5HQCfa0lbEp1ecvn7JtJ6oHYbgHYA
Sl8AoJ7NWoh0yxhKrJbe4IducCTKH1BM
=MdK+
-----END PGP SIGNATURE-----

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


Mime
View raw message