java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed.

Spring JIRA | Tim Lenz | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    SEC-324: AccessDeniedHandlerImpl always throws IllegalStateException

    GitHub | 1 decade ago | spring-issuemaster
    java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed.
  2. 0

    Response status is being set after forwarding to the error page. Logs are being filled with java.lang.IllegalStateExceptions. Currently: rd.forward(request, response); ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN); Should be?: ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN); rd.forward(request, response); Stack trace: 2006-07-20 14:27:44,114 ERROR org.acegisecurity.ui.AccessDeniedHandlerImpl - Error processing org.acegisecurity.wrapper.SavedRequestAwareWrapper@52bd52bd java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed. at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at com.ibm.ws.webcontainer.srt.SRTServletResponse.setStatus(SRTServletResponse.java:931) at org.acegisecurity.ui.AccessDeniedHandlerImpl.handle(AccessDeniedHandlerImpl.java) at org.acegisecurity.ui.ExceptionTranslationFilter.handleException(ExceptionTranslationFilter.java:166) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)

    Spring JIRA | 1 decade ago | Tim Lenz
    java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed.
  3. 0

    Response status is being set after forwarding to the error page. Logs are being filled with java.lang.IllegalStateExceptions. Currently: rd.forward(request, response); ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN); Should be?: ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN); rd.forward(request, response); Stack trace: 2006-07-20 14:27:44,114 ERROR org.acegisecurity.ui.AccessDeniedHandlerImpl - Error processing org.acegisecurity.wrapper.SavedRequestAwareWrapper@52bd52bd java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed. at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at com.ibm.ws.webcontainer.srt.SRTServletResponse.setStatus(SRTServletResponse.java:931) at org.acegisecurity.ui.AccessDeniedHandlerImpl.handle(AccessDeniedHandlerImpl.java) at org.acegisecurity.ui.ExceptionTranslationFilter.handleException(ExceptionTranslationFilter.java:166) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)

    Spring JIRA | 1 decade ago | Tim Lenz
    java.lang.IllegalStateException: ERROR: Cannot set header. Response already committed.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IllegalStateException from JavaProject.getOptions

    Eclipse Bugzilla | 1 decade ago | aeschli
    java.lang.IllegalStateException: Preference node "org.eclipse.jdt.core" has been removed.
  6. 0

    outputStream already obtained | Coding Forums

    thecodingforums.com | 1 year ago
    java.lang.IllegalStateException: OutputStream already obtained

  1. rp 1 times, last 2 months ago
1 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

    ERROR: Cannot set header. Response already committed.

    at java.lang.Throwable.<init>()
  2. Java RT
    Throwable.<init>
    1. java.lang.Throwable.<init>(Throwable.java)
    2. java.lang.Throwable.<init>(Throwable.java)
    2 frames
  3. com.ibm.ws
    SRTServletResponse.setStatus
    1. com.ibm.ws.webcontainer.srt.SRTServletResponse.setStatus(SRTServletResponse.java:931)
    1 frame
  4. Acegi Security Core
    FilterToBeanProxy.doFilter
    1. org.acegisecurity.ui.AccessDeniedHandlerImpl.handle(AccessDeniedHandlerImpl.java)
    2. org.acegisecurity.ui.ExceptionTranslationFilter.handleException(ExceptionTranslationFilter.java:166)
    3. org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)
    4. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    5. org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    6. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    7. org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    8. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    9. org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
    10. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    11. org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
    12. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    13. org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
    14. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    15. org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191)
    16. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    17. org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
    18. org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
    18 frames