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

Jenkins JIRA | Cees Bos | 6 years ago
  1. 0

    We have the Monitoring plugin installed (http://wiki.jenkins-ci.org/display/JENKINS/Monitoring) In the errorlist we see a large number of errors for image requests: java.lang.IllegalStateException: getWriter() has already been called for this response at org.apache.catalina.connector.Response.getOutputStream(Response.java:576) at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:181) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102) at net.bull.javamelody.CounterResponseStream.<init>(CounterResponseStream.java:39) at net.bull.javamelody.CounterServletResponseWrapper.createOutputStream(CounterServletResponseWrapper.java:76) at net.bull.javamelody.FilterServletResponseWrapper.getOutputStream(FilterServletResponseWrapper.java:110) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102) at org.kohsuke.stapler.ResponseImpl.getOutputStream(ResponseImpl.java:82) at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:405) at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:242) at org.kohsuke.stapler.Stapler.service(Stapler.java:150) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:151) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:129) at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73) at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:46) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:51) // GREEN BALLS PLUGIN at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619)

    Jenkins JIRA | 6 years ago | Cees Bos
    java.lang.IllegalStateException: getWriter() has already been called for this response
  2. 0

    We have the Monitoring plugin installed (http://wiki.jenkins-ci.org/display/JENKINS/Monitoring) In the errorlist we see a large number of errors for image requests: java.lang.IllegalStateException: getWriter() has already been called for this response at org.apache.catalina.connector.Response.getOutputStream(Response.java:576) at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:181) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102) at net.bull.javamelody.CounterResponseStream.<init>(CounterResponseStream.java:39) at net.bull.javamelody.CounterServletResponseWrapper.createOutputStream(CounterServletResponseWrapper.java:76) at net.bull.javamelody.FilterServletResponseWrapper.getOutputStream(FilterServletResponseWrapper.java:110) at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102) at org.kohsuke.stapler.ResponseImpl.getOutputStream(ResponseImpl.java:82) at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:405) at org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:242) at org.kohsuke.stapler.Stapler.service(Stapler.java:150) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:151) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:129) at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73) at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:46) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:51) // GREEN BALLS PLUGIN at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619)

    Jenkins JIRA | 6 years ago | Cees Bos
    java.lang.IllegalStateException: getWriter() has already been called for this response
  3. 0

    Tomcat Error: "getWriter() has already been called..." w/ Spring Security, Spring MVC, MeteorServlet

    GitHub | 5 years ago | keaplogik
    java.lang.RuntimeException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: getWriter() has already been called for this response
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Got an exception when tried to modify xml response in custom filter

    Stack Overflow | 3 years ago | Danyan
    java.lang.IllegalStateException: getWriter() has already been called for this response
  6. 0

    Filter to intercept server output

    Stack Overflow | 3 years ago | Stefana Fratean
    java.lang.IllegalStateException: getWriter() has already been called for this response

    7 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

      getWriter() has already been called for this response

      at org.apache.catalina.connector.Response.getOutputStream()
    2. Glassfish Core
      ResponseFacade.getOutputStream
      1. org.apache.catalina.connector.Response.getOutputStream(Response.java:576)
      2. org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:181)
      2 frames
    3. JavaServlet
      ServletResponseWrapper.getOutputStream
      1. javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102)
      1 frame
    4. net.bull.javamelody
      FilterServletResponseWrapper.getOutputStream
      1. net.bull.javamelody.CounterResponseStream.<init>(CounterResponseStream.java:39)
      2. net.bull.javamelody.CounterServletResponseWrapper.createOutputStream(CounterServletResponseWrapper.java:76)
      3. net.bull.javamelody.FilterServletResponseWrapper.getOutputStream(FilterServletResponseWrapper.java:110)
      3 frames
    5. JavaServlet
      ServletResponseWrapper.getOutputStream
      1. javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102)
      1 frame
    6. Stapler
      Stapler.service
      1. org.kohsuke.stapler.ResponseImpl.getOutputStream(ResponseImpl.java:82)
      2. org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:405)
      3. org.kohsuke.stapler.Stapler.serveStaticResource(Stapler.java:242)
      4. org.kohsuke.stapler.Stapler.service(Stapler.java:150)
      4 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      1 frame
    8. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      2 frames
    9. Hudson
      PluginServletFilter$1.doFilter
      1. hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      1 frame
    10. net.bull.javamelody
      PluginMonitoringFilter.doFilter
      1. net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:151)
      2. net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:129)
      3. net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73)
      3 frames
    11. org.jvnet.hudson
      HudsonMonitoringFilter.doFilter
      1. org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:46)
      1 frame
    12. Hudson
      PluginServletFilter$1.doFilter
      1. hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97)
      1 frame