tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat IllegalStateException when load is high
Date Fri, 05 Feb 2010 16:04:33 GMT
Hash: SHA1


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


> 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 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
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


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

View raw message