【问题标题】:rich:fileUpload stackoverflow error at AjaxOutputTracker.getAjaxOutputsRich:fileUpload stackoverflow 错误在 AjaxOutputTracker.getAjaxOutputs
【发布时间】:2016-07-15 09:18:38
【问题描述】:

我目前正在迁移到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

以前它在旧版本中工作..知道我做错了什么吗?我怀疑是我错过了导致此问题的配置。

【问题讨论】:

  • 什么是“旧版本”?没有 PF 还是使用较旧的 RF 和 JSF?
  • 没有 PF 和旧的 RF 和 JSF。
  • 你解决了jQuery版本冲突吗(因为总是有这样的冲突)?顺便提一句。这看起来有点可疑,在 findComponent 中的 SOE。
  • 可疑是什么意思?你的意思是这个问题可能是由 jQuery 冲突引起的?
  • 这意味着我不知道它可能是什么以及可能导致它的原因。 (jQuery 可以混合 rich:fileUpload 行为,但不会导致任何服务器错误)

标签: java jsf richfaces stack-overflow


【解决方案1】:

经过这里和那里的一些测试,我实际上设法解决了这个问题。修复只是将 limitRender="true" 并解决了这个问题。

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

【讨论】:

    猜你喜欢
    • 2011-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    • 2011-12-19
    • 2011-12-26
    • 2015-08-23
    • 1970-01-01
    相关资源
    最近更新 更多