I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception:
java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Unknown Source) org.apache.catalina.connector.Request.getSession(Unknown Source) org.apache.catalina.connector.RequestFacade.getSession(Unknown Source) javax.servlet.http.HttpServletRequestWrapper.getSession(Unknown Source) org.apache.tapestry5.internal.services.RequestImpl.getSession(RequestImpl.java:99) $Request_11fda81101a.getSession($Request_11fda81101a.java) $Request_11fda810fec.getSession($Request_11fda810fec.java) org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.requestDidComplete(SessionApplicationStatePersistenceStrategy.java:126) org.apache.tapestry5.internal.services.EndOfRequestListenerHubImpl.fire(EndOfRequestListenerHubImpl.java:40) ... On Fri, Mar 6, 2009 at 6:47 AM, Angelo Chen <angelochen...@yahoo.com.hk> wrote: > > I have same error, the reason is, I have a filer to trim off the long > jsession IDs from url, solution was, I stopped using invalidate in the T5 > side. however, according to Peter, this happens when you have a sendRedirect > without a matching return true in a dispatcher, you can try that. > > > Harald Geritzer-2 wrote: >> >> >> hi all, >> >> the following code causes IllegalStateExceptions on tomcat 6 while using >> jetty it works without >> errors. any idea? >> >> public URL onActionFromLinkLogoff() { >> User user = userDao.load(getVisit().getUserId()); >> auditDao.audit(AuditType.LOGOFF, user); >> >> String startPage = getVisit().getStartPage(); >> Session session = request.getSession(false); >> >> componentResources.discardPersistentFieldChanges(); >> >> if (null != session) >> session.invalidate(); >> try { >> return new URL(startPage); >> } catch (MalformedURLException e) { >> return null; >> } >> } >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/-T5-5.0.18--java.lang.IllegalStateException%3A-Cannot-create-a-session-after-the-response-has-been-committed-tp22369307p22369465.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org