java.lang.IllegalStateException: getOutputStream() has already been called for this response

Apache's JIRA Issue Tracker | Bryan Hansen | 1 decade ago
  1. 0

    If I have the ExtensionsFilter configured in my web.xml it throws an error whenever a page is not found saying that the response is already committed instead of just displaying the 404 error page that I have created. java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:599) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195) at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75) at org.apache.jsp.errors._404_jsp._jspService(_404_jsp.java:67) If I comment out the ExtensionsFilter it works fine and displays the 404 splash page from my application as it should. Here is the snippet from my web.xml: <filter> <filter-name>MyFacesExtensionsFilter</filter-name> <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class> <init-param> <description>Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadMaxFileSize</param-name> <param-value>100m</param-value> </init-param> <init-param> <description>Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadThresholdSize</param-name> <param-value>100k</param-value> </init-param> </filter> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <url-pattern>*.jsf</url-pattern> </filter-mapping>

    Apache's JIRA Issue Tracker | 1 decade ago | Bryan Hansen
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
  2. 0

    If I have the ExtensionsFilter configured in my web.xml it throws an error whenever a page is not found saying that the response is already committed instead of just displaying the 404 error page that I have created. java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:599) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195) at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75) at org.apache.jsp.errors._404_jsp._jspService(_404_jsp.java:67) If I comment out the ExtensionsFilter it works fine and displays the 404 splash page from my application as it should. Here is the snippet from my web.xml: <filter> <filter-name>MyFacesExtensionsFilter</filter-name> <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class> <init-param> <description>Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadMaxFileSize</param-name> <param-value>100m</param-value> </init-param> <init-param> <description>Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadThresholdSize</param-name> <param-value>100k</param-value> </init-param> </filter> <filter-mapping> <filter-name>MyFacesExtensionsFilter</filter-name> <url-pattern>*.jsf</url-pattern> </filter-mapping>

    Apache's JIRA Issue Tracker | 1 decade ago | Bryan Hansen
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Avoiding java.lang.IllegalStateException in jsp

    Stack Overflow | 4 years ago | S.S.Nath
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
  5. 0

    Spring MVC Roo generated app :: getOutputStream() has already been called for this response when returning value with @ResponseBody

    Stack Overflow | 6 years ago | alexmnyc
    java.lang.IllegalStateException: getOutputStream() has already been called for this response

  1. Piz 24 times, last 4 months ago
  2. mortalman7 10 times, last 7 months ago
  3. Bugger 1 times, last 8 months ago
  4. eilonreshef 1 times, last 9 months ago
39 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

    getOutputStream() has already been called for this response

    at org.apache.catalina.connector.Response.getWriter()
  2. Glassfish Core
    ResponseFacade.getWriter
    1. org.apache.catalina.connector.Response.getWriter(Response.java:599)
    2. org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
    2 frames
  3. GWT dev
    JspFactoryImpl.releasePageContext
    1. org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
    2. org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
    3. org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
    4. org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
    5. org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
    5 frames
  4. org.apache.jsp
    _404_jsp._jspService
    1. org.apache.jsp.errors._404_jsp._jspService(_404_jsp.java:67)
    1 frame