One thing I did recently that might have some relationship to it, is that I put 
StripesFilter ahead of SecurityFilter; I looked at the code of stripesFilter, 
and I can see that  it sets Locale and CharacterEncoding on the response object 
before passing control to the chain.

Could that potentially be a problem?

The worst thing is that this problem happens on random pages and the only the 
code on the stack at the time is StripesFilter + SecurityFilter.


-----Original Message-----
From: Leonard Gestrin [mailto:[email protected]]
Sent: Monday, April 06, 2009 10:06 AM
To: Stripes Users List
Subject: Re: [Stripes-users] java.lang.IllegalStateException: Cannot create a 
session after the response has been committed at 
org.apache.catalina.connector.Request.doGetSession(Request.java:2214 )

Hi Oscar,
Thanks for replying.

SecurityFilter is second filter in the request. StripesFilter is the first one.

The session is accessed in doFilter() method.

My theory is that, since tomcat reuses request/response objects, somewhere in 
the app, some action does something to the object(s), which causes it to not 
get recycled properly and the next client request becomes the victim of it.

-----Original Message-----
From: Oscar Westra van Holthe - Kind [mailto:[email protected]]
Sent: Sunday, April 05, 2009 8:52 AM
To: Stripes Users List
Subject: Re: [Stripes-users] java.lang.IllegalStateException: Cannot create a 
session after the response has been committed at 
org.apache.catalina.connector.Request.doGetSession(Request.java:2214 )

Hi Leonard,

It seems to me the response object is used before you create a session. So
some things to check are:
- Where in the request handling is your security filter located?
- When is the session accessed? After the call to doFilter()?

To prevent this exception, ensure the session is created & added to the
response before anything is written to the response. Preferably in the first
filter, before the call to doFilter(). This way the cookie header with the
JSESSIONID cookie is added before the response is written to, as writing to
the response commits the response.


Oscar

--
   ,-_
  /() ) Oscar Westra van holthe - Kind      http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  QED - Quite Easily Done

------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to