GoogleSearchBox

Custom Search

Friday, June 28, 2013

Cannot create a session after the response has been committed : CAS application error

Below is an issue related to CAS,

Env is:  CAS 3.5.2 deployed on Tomcat 6.

"When I login I get an error. If I refresh/resubmit the information it goes through and operates normally. Any advice would be greatly appreciated."

The error is below:
type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Cannot create a session after the response has been committed

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128) org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57) org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63) root cause java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Request.java:2400) org.apache.catalina.connector.Request.getSession(Request.java:2120) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) org.springframework.webflow.context.servlet.HttpSessionMap.getMutex(HttpSessionMap.java:98) org.springframework.webflow.core.collection.LocalSharedAttributeMap.getMutex(LocalSharedAttributeMap.java:39) org.springframework.webflow.conversation.impl.ContainedConversation.unlock(ContainedConversation.java:108) org.springframework.webflow.execution.repository.support.ConversationBackedFlowExecutionLock.unlock(ConversationBackedFlowExecutionLock.java:55) org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:178) org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128) org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57) org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63)

Solution:
"I assume that happens when there is no 'service' param and CAS tries to render a successful generic login page. Correct? If so, that is a side effect that is caused by 'terminateWebSessionListener' bean defined in cas-servlet.xml. You could a) disable one b) set the 'timeToDieInSeconds' property to a higher value to remedy this annoyance, like so":

<bean id="terminateWebSessionListener" class="org.jasig.cas.web.flow.TerminateWebSessionListener" 
      p:serviceManagerUrl="${cas.securityContext.serviceProperties.service}"
      p:timeToDieInSeconds="5"/>
Via Reference:
https://lists.wisc.edu/read/messages?id=27757318#27757318