java.lang.IllegalStateException: WRITER

Jenkins JIRA | Jesse Glick | 3 years ago
  1. 0

    A {{RuntimeException}} is thrown inside {{HttpResponseRenderer}}. Rather than printing this stack trace to the log, I get {code:none} [ERROR] /jenkins/$stapler/bound/db022930-dbbe-4ded-8c68-8690f97920f3/stuff java.lang.IllegalStateException: WRITER at org.mortbay.jetty.Response.getOutputStream(Response.java:531) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112) at org.kohsuke.stapler.compression.CompressionServletResponse.activateCompressionIfNecessary(CompressionServletResponse.java:44) at org.kohsuke.stapler.compression.CompressionServletResponse.setHeader(CompressionServletResponse.java:31) at javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:160) at org.kohsuke.stapler.ResponseImpl.getCompressedOutputStream(ResponseImpl.java:278) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.createOutputStream(DefaultScriptInvoker.java:88) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.createXMLOutput(DefaultScriptInvoker.java:68) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:51) at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631) at hudson.init.impl.InstallUncaughtExceptionHandler$1.reportException(InstallUncaughtExceptionHandler.java:27) at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:63) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:58) at ... {code} which is not exactly helpful. It seems that {{rsp.getWriter()}} has already been called, and Jetty correctly rejects the attempt to call {{rsp.setHeader("Content-Encoding","gzip")}}.

    Jenkins JIRA | 3 years ago | Jesse Glick
    java.lang.IllegalStateException: WRITER
  2. 0

    A {{RuntimeException}} is thrown inside {{HttpResponseRenderer}}. Rather than printing this stack trace to the log, I get {code:none} [ERROR] /jenkins/$stapler/bound/db022930-dbbe-4ded-8c68-8690f97920f3/stuff java.lang.IllegalStateException: WRITER at org.mortbay.jetty.Response.getOutputStream(Response.java:531) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112) at org.kohsuke.stapler.compression.CompressionServletResponse.activateCompressionIfNecessary(CompressionServletResponse.java:44) at org.kohsuke.stapler.compression.CompressionServletResponse.setHeader(CompressionServletResponse.java:31) at javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:160) at org.kohsuke.stapler.ResponseImpl.getCompressedOutputStream(ResponseImpl.java:278) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.createOutputStream(DefaultScriptInvoker.java:88) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.createXMLOutput(DefaultScriptInvoker.java:68) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:51) at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631) at hudson.init.impl.InstallUncaughtExceptionHandler$1.reportException(InstallUncaughtExceptionHandler.java:27) at org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:63) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:58) at ... {code} which is not exactly helpful. It seems that {{rsp.getWriter()}} has already been called, and Jetty correctly rejects the attempt to call {{rsp.setHeader("Content-Encoding","gzip")}}.

    Jenkins JIRA | 3 years ago | Jesse Glick
    java.lang.IllegalStateException: WRITER
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    GAE throws IllegalStateException: WRITER

    Stack Overflow | 5 years ago | Igor Artamonov
    java.lang.IllegalStateException: WRITER
  5. 0

    Serve image from blob store

    Google Groups | 6 years ago | Ahmed Shoeib
    java.lang.IllegalStateException: WRITER

    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

      WRITER

      at org.mortbay.jetty.Response.getOutputStream()
    2. Jetty Server
      Response.getOutputStream
      1. org.mortbay.jetty.Response.getOutputStream(Response.java:531)
      1 frame
    3. JavaServlet
      ServletResponseWrapper.getOutputStream
      1. javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112)
      1 frame
    4. Stapler
      CompressionServletResponse.setHeader
      1. org.kohsuke.stapler.compression.CompressionServletResponse.activateCompressionIfNecessary(CompressionServletResponse.java:44)
      2. org.kohsuke.stapler.compression.CompressionServletResponse.setHeader(CompressionServletResponse.java:31)
      2 frames
    5. JavaServlet
      HttpServletResponseWrapper.setHeader
      1. javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:160)
      1 frame
    6. Stapler
      ResponseImpl.getCompressedOutputStream
      1. org.kohsuke.stapler.ResponseImpl.getCompressedOutputStream(ResponseImpl.java:278)
      1 frame
    7. Stapler Jelly
      JellyFacet$1.dispatch
      1. org.kohsuke.stapler.jelly.DefaultScriptInvoker.createOutputStream(DefaultScriptInvoker.java:88)
      2. org.kohsuke.stapler.jelly.DefaultScriptInvoker.createXMLOutput(DefaultScriptInvoker.java:68)
      3. org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:51)
      4. org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)
      4 frames
    8. Stapler
      Stapler.invoke
      1. org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      2. org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      3. org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
      3 frames
    9. Hudson
      InstallUncaughtExceptionHandler$1.reportException
      1. hudson.init.impl.InstallUncaughtExceptionHandler$1.reportException(InstallUncaughtExceptionHandler.java:27)
      1 frame
    10. Stapler
      CompressionFilter.doFilter
      1. org.kohsuke.stapler.compression.CompressionFilter.reportException(CompressionFilter.java:63)
      2. org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:58)
      2 frames