2

晚安,伙计们,

我在 Jelastic 的生产中遇到 op: PrimeFaces FileUpload 的问题。(在本地主机工作)

我尝试上传文件,他正在加载并且永无止境。然后在控制台上显示以下错误:

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)

我尝试做几件事: 关注 Catalina 日志:2013 年 1 月 8 日上午 3:28:05 org.primefaces.webapp.MultipartRequest parseRequest 严重:解析文件上传请求时出错

网页.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: 他从来没有在第一行输入metod 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."));  
        }  
    }  

不知道还有什么问题。如果有人可以提供帮助。

4

1 回答 1

1

我解决了我的问题。我禁用了nginx。

于 2013-01-10T00:54:18.200 回答