title: Tomcat + RichFaces 4.1 exceptions when loading file
body: <p>I have deployed my webapp but for some reason, some exceptions appear when trying to load files into server, I don't know why is this happening. Sometimes when I try to upload a file the <code>rich:fileUpload</code> doesn't upload the file, the progress bar of the component never gets filled and an exception like the following appears on Tomcat's log:</p>
  
  <pre><code>may 21, 2012 8:38:04 PM org.richfaces.request.MultipartRequest25 parseIfNecessary
  SEVERE: Exception parsing multipart request: Request prolog cannot be read
  org.richfaces.exception.FileUploadException: Exception parsing multipart request: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:156)
      at org.richfaces.request.MultipartRequest25.parseIfNecessary(MultipartRequest25.java:77)
      at org.richfaces.request.MultipartRequest25.getParameter(MultipartRequest25.java:114)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:75)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:56)
      at java.util.Collections$UnmodifiableMap.get(Collections.java:1339)
      at com.sun.faces.application.view.MultiViewHandler.calculateRenderKitId(MultiViewHandler.java:220)
      at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:155)
      at com.sun.faces.context.FacesContextImpl.isPostback(FacesContextImpl.java:211)
      at javax.faces.context.FacesContextWrapper.isPostback(FacesContextWrapper.java:402)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:188)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.io.IOException: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.readProlog(MultipartRequestParser.java:270)
      at org.richfaces.request.MultipartRequestParser.initialize(MultipartRequestParser.java:172)
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:148)
      ... 30 more
  
  may 21, 2012 8:38:04 PM org.richfaces.request.MultipartRequest25 parseIfNecessary
  SEVERE: Exception parsing multipart request: Request prolog cannot be read
  org.richfaces.exception.FileUploadException: Exception parsing multipart request: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:156)
      at org.richfaces.request.MultipartRequest25.parseIfNecessary(MultipartRequest25.java:77)
      at org.richfaces.request.MultipartRequest25.getParameter(MultipartRequest25.java:114)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:75)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:56)
      at java.util.Collections$UnmodifiableMap.get(Collections.java:1339)
      at com.sun.faces.application.view.MultiViewHandler.calculateRenderKitId(MultiViewHandler.java:220)
      at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:155)
      at com.sun.faces.context.FacesContextImpl.isPostback(FacesContextImpl.java:211)
      at javax.faces.context.FacesContextWrapper.isPostback(FacesContextWrapper.java:402)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:188)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:473)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)
      at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:399)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:191)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.io.IOException: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.readProlog(MultipartRequestParser.java:270)
      at org.richfaces.request.MultipartRequestParser.initialize(MultipartRequestParser.java:172)
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:148)
      ... 33 more
  
  may 21, 2012 8:38:04 PM org.richfaces.request.MultipartRequest25 parseIfNecessary
  SEVERE: Exception parsing multipart request: Request prolog cannot be read
  org.richfaces.exception.FileUploadException: Exception parsing multipart request: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:156)
      at org.richfaces.request.MultipartRequest25.parseIfNecessary(MultipartRequest25.java:77)
      at org.richfaces.request.MultipartRequest25.getParameter(MultipartRequest25.java:114)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:75)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:56)
      at java.util.Collections$UnmodifiableMap.get(Collections.java:1339)
      at com.sun.faces.application.view.MultiViewHandler.calculateRenderKitId(MultiViewHandler.java:220)
      at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:155)
      at com.sun.faces.context.FacesContextImpl.isPostback(FacesContextImpl.java:211)
      at javax.faces.context.FacesContextWrapper.isPostback(FacesContextWrapper.java:402)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:188)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.io.IOException: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.readProlog(MultipartRequestParser.java:270)
      at org.richfaces.request.MultipartRequestParser.initialize(MultipartRequestParser.java:172)
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:148)
      ... 30 more
  
  may 21, 2012 8:38:04 PM org.richfaces.request.MultipartRequest25 parseIfNecessary
  SEVERE: Exception parsing multipart request: Request prolog cannot be read
  org.richfaces.exception.FileUploadException: Exception parsing multipart request: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:156)
      at org.richfaces.request.MultipartRequest25.parseIfNecessary(MultipartRequest25.java:77)
      at org.richfaces.request.MultipartRequest25.getParameter(MultipartRequest25.java:114)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:75)
      at com.sun.faces.context.RequestParameterMap.get(RequestParameterMap.java:56)
      at java.util.Collections$UnmodifiableMap.get(Collections.java:1339)
      at com.sun.faces.application.view.MultiViewHandler.calculateRenderKitId(MultiViewHandler.java:220)
      at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:155)
      at com.sun.faces.context.FacesContextImpl.isPostback(FacesContextImpl.java:211)
      at javax.faces.context.FacesContextWrapper.isPostback(FacesContextWrapper.java:402)
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:188)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:473)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)
      at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:399)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:191)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.io.IOException: Request prolog cannot be read
      at org.richfaces.request.MultipartRequestParser.readProlog(MultipartRequestParser.java:270)
      at org.richfaces.request.MultipartRequestParser.initialize(MultipartRequestParser.java:172)
      at org.richfaces.request.MultipartRequestParser.parse(MultipartRequestParser.java:148)
      ... 33 more
  </code></pre>
  
  <p>Any idea on what could be happening? Where can I start looking for fixing this on my app?</p>
  
  <p>CHeers,</p>