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

Liferay Issues | Jelmer Kuperus | 6 years ago
  1. 0

    [LPS-43358] Liferay Util methods may attempt to create a session after response is committed - Liferay Issues

    liferay.com | 11 months ago
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Even after the response has been committed (for example, on a {{sendRedirect}}), some utility methods may be called. Some of these utility methods will call {{request.getSession()}}, resulting in an {{IllegalStateException}} if a session has not yet been created. {code:title=LanguageUtil.getLanguageId(HttpServletRequest)|borderStyle=solid} java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2886) at org.apache.catalina.connector.Request.getSession(Request.java:2316) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:910) at com.liferay.portal.util.PortalImpl.getLocale(PortalImpl.java:3294) at com.liferay.portal.util.PortalImpl.getLocale(PortalImpl.java:3222) at com.liferay.portal.util.PortalUtil.getLocale(PortalUtil.java:928) at com.liferay.portal.language.LanguageImpl.getLanguageId(LanguageImpl.java:513) at com.liferay.portal.kernel.language.LanguageUtil.getLanguageId(LanguageUtil.java:220) {code} {code:title=SessionParamUtil.getBoolean(HttpServletRequest, HttpServletResponse, String)|borderStyle=solid} java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2886) at org.apache.catalina.connector.Request.getSession(Request.java:2316) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:910) at com.liferay.portal.kernel.util.SessionParamUtil.getBoolean(SessionParamUtil.java:35) {code}

    Liferay Issues | 3 years ago | Minhchau Dang
    java.lang.IllegalStateException: Cannot create a session after the response has been committed
  4. 0

    Even after the response has been committed (for example, on a {{sendRedirect}}), some utility methods may be called. Some of these utility methods will call {{request.getSession()}}, resulting in an {{IllegalStateException}} if a session has not yet been created. {code:title=LanguageUtil.getLanguageId(HttpServletRequest)|borderStyle=solid} java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2886) at org.apache.catalina.connector.Request.getSession(Request.java:2316) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:910) at com.liferay.portal.util.PortalImpl.getLocale(PortalImpl.java:3294) at com.liferay.portal.util.PortalImpl.getLocale(PortalImpl.java:3222) at com.liferay.portal.util.PortalUtil.getLocale(PortalUtil.java:928) at com.liferay.portal.language.LanguageImpl.getLanguageId(LanguageImpl.java:513) at com.liferay.portal.kernel.language.LanguageUtil.getLanguageId(LanguageUtil.java:220) {code} {code:title=SessionParamUtil.getBoolean(HttpServletRequest, HttpServletResponse, String)|borderStyle=solid} java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2886) at org.apache.catalina.connector.Request.getSession(Request.java:2316) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:898) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:910) at com.liferay.portal.kernel.util.SessionParamUtil.getBoolean(SessionParamUtil.java:35) {code}

    Liferay Issues | 3 years ago | Minhchau Dang
    java.lang.IllegalStateException: Cannot create a session after the response has been committed

  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:2381)
    2. org.apache.catalina.connector.Request.getSession(Request.java:2098)
    3. org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
    4. org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:844)
    4 frames
  3. Liferay Portal Service
    PortalUtil.getLocale
    1. com.liferay.portal.util.PortalImpl.getLocale(PortalImpl.java:1959)
    2. com.liferay.portal.util.PortalUtil.getLocale(PortalUtil.java:573)
    2 frames
  4. Liferay Portal Impl
    LanguageImpl.getLanguageId
    1. com.liferay.portal.language.LanguageImpl.getLanguageId(LanguageImpl.java:398)
    1 frame
  5. Liferay Portal Service
    LanguageUtil.getLanguageId
    1. com.liferay.portal.kernel.language.LanguageUtil.getLanguageId(LanguageUtil.java:189)
    1 frame
  6. Liferay Portal Impl
    LanguageFilter.translateResponse
    1. com.liferay.portal.servlet.filters.language.LanguageFilter.translateResponse(LanguageFilter.java:99)
    1 frame