title: Getting 'Cannot set header. Response already committed' with primefaces fileupload
body: <p>i am using jsf 2 (<strong>javax.faces-2.0.10.jar</strong>) and <strong>primefaces 3.5</strong> on <strong>websphere 8.5.0.1</strong> and i am also using the file upload jars:</p>
  
  <ul>
  <li><strong>commons-fileupload-1.3.1.jar</strong></li>
  <li><strong>commons-io-2.4.jar</strong></li>
  </ul>
  
  <p>and i am trying to use primefaces fileupload component as follows:</p>
  
  <pre><code>&lt;h:form  id="frm" enctype="multipart/form-data"&gt;
          &lt;p:fileUpload id="fileUpload" value="#{uploadDocument.file}"
          fileUploadListener="#{uploadDocument.handleFileUpload}" mode="advanced" dragDropSupport="false"  
                     sizeLimit="10000000" fileLimit="3"  /&gt; 
          &lt;/h:form&gt;
  </code></pre>
  
  <p><strong>web.xml config:</strong></p>
  
  <pre><code>&lt;filter&gt;
         &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
         &lt;filter-class&gt;org.primefaces.webapp.filter.FileUploadFilter&lt;/filter-class&gt;
         &lt;init-param&gt;
              &lt;param-name&gt;uploadDirectory&lt;/param-name&gt;
              &lt;param-value&gt;C:/uploadFolder&lt;/param-value&gt;
         &lt;/init-param&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;/filter-mapping&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>after choosing the file and clicking upload, the file is not uploaded and i am getting following warning in log file:</p>
  
  <pre><code>com.ibm.ws.webcontainer.srt.SRTServletResponse addHeader SRVE8094W: WARNING: Cannot set header. Response already committed.
  </code></pre>
  
  <p>please advise why the file upload is not working ?</p>