Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2408

"getOutputStream() has already been called for this response" from HudsonAuthenticationEntryPoint.commence

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • _unsorted
    • None
    • Platform: All, OS: All

      Hudson 1.252. Without being logged in as admin, I entered in my URL bar:

      http://deadlock.netbeans.org/hudson/job/trunk/configure

      expecting to be taken to a login screen (and from there redirected to the config
      page). Instead I got:

      java.lang.IllegalStateException: getOutputStream() has already been called for
      this response
      org.apache.catalina.connector.Response.getWriter(Response.java:599)
      org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
      hudson.security.HudsonAuthenticationEntryPoint.commence(HudsonAuthenticationEntryPoint.java:52)
      org.acegisecurity.ui.ExceptionTranslationFilter.sendStartAuthentication(ExceptionTranslationFilter.java:276)
      org.acegisecurity.ui.ExceptionTranslationFilter.handleException(ExceptionTranslationFilter.java:220)
      org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:181)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:55)
      org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:55)
      hudson.security.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:89)
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:55)
      hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:44)
      hudson.security.HudsonFilter.doFilter(HudsonFilter.java:82)

          [JENKINS-2408] "getOutputStream() has already been called for this response" from HudsonAuthenticationEntryPoint.commence

          Alan Harder added a comment -

          working on this.

          Alan Harder added a comment - working on this.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=14049
          Log:
          [FIXED JENKINS-2408] On a failed permission check for anonymous, it seems
          rsp.getOutputStream() has already been called before reaching this class.
          So use getOutputStream() instead of getWriter() to send html for login
          redirect (and catch exception/use getWriter, just in case).

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/security/HudsonAuthenticationEntryPoint.java http://fisheye4.cenqua.com/changelog/hudson/?cs=14049 Log: [FIXED JENKINS-2408] On a failed permission check for anonymous, it seems rsp.getOutputStream() has already been called before reaching this class. So use getOutputStream() instead of getWriter() to send html for login redirect (and catch exception/use getWriter, just in case).

            mindless Alan Harder
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: