rich:AjaxOutputTracker.getAjaxOutputs中的fileUpload stackoverflow错误

时间:2016-07-15 09:18:38

标签: java jsf richfaces stack-overflow

我目前正在迁移到richfaces 4.5,JSF2.2并添加primefaces-6.0(对于richfaces不支持的其他功能) 我正在使用Tomcat 8作为服务器。

在xhtml文件中,我只是将下面的简单代码用于测试:

<rich:fileUpload id="upload"
     fileUploadListener="#{cc.attrs.beanPage.uploadListener}"
     maxFilesQuantity="1"
     acceptedTypes=".ppt, .pptx, .doc, .docx, .txt, .xls, .xlsx, .zip, .pdf"  />

并且在uploadListener中我只将一些东西放到调试

 public void uploadListener(FileUploadEvent event) {
    this.item = event.getUploadedFile();
    String projectFileName = this.item.getName();
 }

当我调试时,我看到它到达了监听器并且没有错误地结束。但是我在听众完成后得到了这个错误:

java.lang.StackOverflowError
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91).. keep repeating
Jul 15, 2016 4:09:36 PM org.primefaces.application.exceptionhandler.PrimeExceptionHandler logException
SEVERE: null
java.lang.StackOverflowError
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)... keep repeating

Jul 15, 2016 4:09:38 PM org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/PORTAL].[Faces Servlet] invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/PORTAL] threw exception [Servlet execution threw an exception] with root cause
java.lang.StackOverflowError
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:679)
    at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:643)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:86)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)
    at org.richfaces.context.AjaxOutputTracker.getAjaxOutputs(AjaxOutputTracker.java:91)..... and so on keep repeating

以前它的旧版本工作..对我做错了什么的任何想法?我怀疑有一个我错过的配置导致这个。

1 个答案:

答案 0 :(得分:1)

在这里和那里进行一些测试之后,我实际上设法解决了这个问题。修复只是把limitRender =“true”,它解决了这个问题。

这可能是一个非常简单的问题,但实际上我不明白为什么这是必要的,因为我没有在这个文件上载中添加任何渲染。我可能会错过表格中的某些内容。 编辑:经过一些检查,我发现页面中有ajaxRendered = true,但我不知道为什么它会给出递归溢出问题,因为它不会互相渲染。我可能会遗漏一些东西。