2013-01-08 71 views
2

晚安夥計,PrimeFaces X Jelastic X p:fileUpload

我有一個問題:PrimeFaces FileUpload在生產Jelastic。 (在本地作品中)

我嘗試上傳一個文件,並且他正在加載並且永不結束。然後在控制檯上顯示以下錯誤:

Jan 8, 2013 3:28:05 AM org.apache.catalina.core.StandardWrapperValve invoke 
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/timbre] threw exception 
java.io.IOException: Processing of multipart/form-data request failed. Read timed out 
    at org.primefaces.webapp.MultipartRequest.parseRequest(MultipartRequest.java:69) 
    at org.primefaces.webapp.MultipartRequest.<init>(MultipartRequest.java:51) 
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at com.timbre.filter.FilterLogin.doFilter(FilterLogin.java:53) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    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:98) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) 
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:662) 

我試着做幾件事情:按照卡塔利娜日誌: 2013年1月8日上午03時28分05秒org.primefaces.webapp.MultipartRequest的parseRequest 重度:錯誤解析文件上傳請求

的web.xml:

<servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.jsf</url-pattern> 
</servlet-mapping> 
<filter> 
    <filter-name>PrimeFaces FileUpload Filter</filter-name> 
    <filter-class> org.primefaces.webapp.filter.FileUploadFilter</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>PrimeFaces FileUpload Filter</filter-name> 
    <servlet-name>Faces Servlet</servlet-name> 
</filter-mapping> 

頁:

<div class="controls controls-row"> 
          <h:outputLabel for="foto" value="Foto:" style="font-weight:bold" />       
          <p:fileUpload id="foto" fileUploadListener="#{instrumentoBean.handleFileUpload}" styleClass="span6" dragDropSupport="true" auto="true" mode="advanced" label="Selecione" update="growlDetail" sizeLimit="1000000" allowTypes="/(\.|\/)(jpe?g|png)$/"/> 
         </div> 

MB:他從來沒有在第一行輸入梅託德handleFileUpload

public void handleFileUpload(FileUploadEvent event) { 
     System.out.println("He never pass here in Jelastic. In Localhost is ok"); 

     instrumento.setiFotoInstrumento(arquivo.upload(event)); 
     if (instrumento.getiFotoInstrumento() == null) { 
      System.out.println("Vai 2"); 
      FacesContext.getCurrentInstance().addMessage( 
        null, 
        new FacesMessage("Erro! ", event.getFile().getFileName() 
          + " não foi enviada.")); 
     } else { 
      System.out.println("Vai 3"); 
      FacesContext.getCurrentInstance().addMessage( 
        null, 
        new FacesMessage("Sucesso! ", event.getFile().getFileName() 
          + " foi enviada.")); 
     } 
    } 

不知道還有什麼可能有問題。如果有人可以幫忙。

回答

1

我解決了我的問題。我禁用了nginx。