users@glassfish.java.net

Re: PWC3999: Cannot create a session after the response has been committed

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Mon, 11 Jan 2010 12:00:50 -0800

On 01/11/10 10:48 AM, glassfish_at_javadesktop.org wrote:
> this problem I have in glassfish v3 in glassfish v2 no problem.
>
> The entire error is this:
>
> [#|2010-01-11T16:44:52.977-0200|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=32;_ThreadName=http-thread-pool-80-(2);|StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception
> java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed
>

The relevant code has not changed between v2 and v3. Looks like
support for cookies has been enabled, and the application is
attempting to create an HTTP session after the response has already
been committed. This must result in an error, because once the
response has been committed, the response headers have already been
sent to the client, meaning it is impossible to add any Set-Cookie
header (carrying the id of the new HTTP session) to the response.

Is it possible that
org.springframework.security.util.SessionUtils.startNewSessionIfRequired
used to return false in v2?

Jan

> [Message sent by forum member 'roque_ing' (roque.ing_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=380132
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>