为什么会失败<rich:fileupload>组件?

时间:2018-04-10 22:00:41

标签: java jsf richfaces

我有一个正在生产的系统,最近收到配置中的更新依赖项,我实际上不知道哪些更改和哪些依赖项。系统运行正常,但突然上传文件功能开始抛出此异常

17:13:13,282 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-/0.0.0.0:8080-1) JSF1073: javax.faces.event.AbortProcessingException caught during processing of APPLY_REQUEST_VALUES 2 : UIComponent-ClientId=form3:upload, Message=Method not found: com.global.session.DeudaHome@52ce8a59.listener()
17:13:13,283 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-/0.0.0.0:8080-1) Method not found: com.global.session.DeudaHome@52ce8a59.listener(): javax.faces.event.AbortProcessingException: Method not found: com.global.session.DeudaHome@52ce8a59.listener()
    at org.richfaces.event.MethodExpressionEventListener.processEvent(MethodExpressionEventListener.java:133) [richfaces-components-ui-4.2.2.Final.jar:4.2.2.Final]
    at org.richfaces.view.facelets.FileUploadHandler$FileUploadListenerImpl.processFileUpload(FileUploadHandler.java:55) [richfaces-components-ui-4.2.2.Final.jar:4.2.2.Final]
    at org.richfaces.event.FileUploadEvent.processListener(FileUploadEvent.java:48) [richfaces-components-api-4.2.2.Final.jar:4.2.2.Final]
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:751) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at com.global.filters.FilterContentSecurityPolicy.doFilter(FilterContentSecurityPolicy.java:101) [RPM-BCPEC-ejb.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at com.global.filters.FilterSecurity.doFilter(FilterSecurity.java:37) [RPM-BCPEC-ejb.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.0.CR1]
    at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:2.3.0.CR1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

我从异常中理解的是,没有找到方法listener的定义,但该方法在asossiated Controller中定义,当然使用类型FileUploadEvent的参数,但到目前为止据我所知,这是正确的,组件应该使用参数调用方法。

没有对代码进行任何更改,正如我之前提到的那样,重复部分已经结束了。你知道为什么会失败吗?哪个依赖可以打破这个?或哪些配置相关?任何想法都是受欢迎的。

XHTML页面

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"
                xmlns:p="http://primefaces.org/ui" xmlns:a="http://richfaces.org/a4j">

    <ui:define name="body">
        <h:form id="form3" enctype="multipart/form-data">

            <p:panel>
                <p:panel id="filePanel">
                    <f:facet name="header">
                        <h:outputText value="Subir archivo"></h:outputText>
                    </f:facet>
                    <h:panelGrid columns="2" columnClasses="top,top">
                        <h:panelGroup>
                            <p:selectOneMenu id="serviceIdName"
                                             value="#{deudaHome.idServicio}" style="width: 120px">
                                <f:selectItems value="#{serviceIdNomSelectItems}"/>
                            </p:selectOneMenu>
                            <p:tooltip id="toolTipService" for="serviceIdName"
                                       value="Seleccione el servicio que importara las deudas." position="top"/>
                            <rich:fileUpload fileUploadListener="#{deudaHome.listener}"
                                             maxFilesQuantity="1" id="upload"
                                             addControlLabel="Cargar Archivo Cuota"
                                             disabled="#{deudaHome.archivoSeleccionadoCantidad>0}"
                                             immediateUpload="true"
                                             uploadControlLabel="Procesar Archivo Cuota"
                                             clearAllControlLabel="Vaciar Lista">
                                <a:ajax event="uploadcomplete" render="infoPanel,barraChota"/>
                                <a:ajax event="clear" action="#{deudaHome.clearDatos}"
                                        render="upload,infoPanel,barraChota"/>
                            </rich:fileUpload>
                        </h:panelGroup>

                        <!-- Not Important Stuff -->
                    </h:panelGrid>
                </p:panel>
            </p:panel>
        </h:form>


    </ui:define>

</ui:composition>

Java代码

package com.global.session;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;
import org.richfaces.event.FileUploadEvent;
import org.richfaces.model.UploadedFile;
import com.global.entity.Deuda;

/**
 * Controlador de la vista de deudas
 */
@Name("deudaHome")
public class DeudaHome extends EntityHome<Deuda> {

    // Lot of declarations/definitions

    /**
     * Liestener de eventos
     *
     * @param event evento de subida de fichero
     */
    public void listener(FileUploadEvent event) {

        UploadedFile u = event.getUploadedFile();

        // ** A lot more of not important stuff

    }

}

0 个答案:

没有答案