java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When there is no session the following error happens on {code:xml}<result type="redirect">{code}. {code} [org.apache.struts2.dispatcher.Dispatcher.error:38] [] - Exception occurred during processing request: Cannot create a session after the response has been committed java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2880) ~[catalina.jar:7.0.37] at org.apache.catalina.connector.Request.getSession(Request.java:2315) ~[catalina.jar:7.0.37] at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) ~[catalina.jar:7.0.37] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:177) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:279) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:195) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) ~[xwork-core-2.3.14.3.jar:2.3.14.3] {code} This always happens if you wget your resource that has redirect. The interceptor should check if the session is available and only then perform message storing.
    via by Jan Čustović,
  • When there is no session the following error happens on {code:xml}<result type="redirect">{code}. {code} [org.apache.struts2.dispatcher.Dispatcher.error:38] [] - Exception occurred during processing request: Cannot create a session after the response has been committed java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2880) ~[catalina.jar:7.0.37] at org.apache.catalina.connector.Request.getSession(Request.java:2315) ~[catalina.jar:7.0.37] at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) ~[catalina.jar:7.0.37] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:229) ~[servlet-api.jar:na] at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:177) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:279) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:195) ~[struts2-core-2.3.14.3.jar:2.3.14.3] at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) ~[xwork-core-2.3.14.3.jar:2.3.14.3] {code} This always happens if you wget your resource that has redirect. The interceptor should check if the session is available and only then perform message storing.
    via by Jan Čustović,
    • java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2377) at org.apache.catalina.connector.Request.getSession(Request.java:2097) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216) at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:182) at org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:297) at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:198) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662)

    Users with the same issue

    QrCeric
    1 times, last one,
    Shadd518
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    3 more bugmates