java.lang.IllegalStateException: Cannot create a session after the response has been committed

Apache's JIRA Issue Tracker | Jan Čustović | 3 years ago
  1. 0

    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.

    Apache's JIRA Issue Tracker | 3 years ago | Jan Čustović
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  2. 0

    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.

    Apache's JIRA Issue Tracker | 3 years ago | Jan Čustović
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  3. 0

    [WW-4134] MessageStoreInterceptor java.lang.IllegalStateException if there is no session - ASF JIRA

    apache.org | 1 year ago
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [WW-4134] MessageStoreInterceptor java.lang.IllegalStateException if there is no session - ASF JIRA

    apache.org | 11 months ago
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  6. 0

    Exception evaluating SpringEL expression: "_csrf.token"

    GitHub | 6 months ago | berniegp
    org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/home.html]")

  1. Shadd518 1 times, last 3 months ago
5 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Cannot create a session after the response has been committed

    at org.apache.catalina.connector.Request.doGetSession()
  2. Glassfish Core
    RequestFacade.getSession
    1. org.apache.catalina.connector.Request.doGetSession(Request.java:2377)
    2. org.apache.catalina.connector.Request.getSession(Request.java:2097)
    3. org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
    3 frames
  3. JavaServlet
    HttpServletRequestWrapper.getSession
    1. javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
    1 frame
  4. Struts2
    MessageStoreInterceptor.intercept
    1. org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:182)
    2. org.apache.struts2.interceptor.MessageStoreInterceptor.after(MessageStoreInterceptor.java:297)
    3. org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:198)
    3 frames
  5. XWork
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
    1 frame
  6. Struts2
    StrutsPrepareAndExecuteFilter.doFilter
    1. org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    2. org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
    3. org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
    4. org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    4 frames
  7. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    2 frames
  8. Hibernate
    OpenSessionInViewFilter.doFilterInternal
    1. org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    1 frame
  9. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    1 frame
  10. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    4. org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191)
    5. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    9 frames
  11. Grizzly HTTP
    JIoEndpoint$Worker.run
    1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    3 frames
  12. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:662)
    1 frame