1

我有一个带有以下代码的 Web 应用程序:

<rich:dataScroller id="id1" for="tableX" execute="tableX" page="#{formBackingBean.navigationHelper.scrollerPage}" render="tableX-sc1 tableY" maxPages="5" scrollListener="#{aBean.handleScrollPage()}" fastControls="hide" />

我使用richfaces 4.2.0 final,在JBoss 6 下(我使用Mojarra 2.0.3 作为JSF 实现)这工作正常。我在 JBoss EAP 6(即 Jboss 7)上安装了应用程序,但出现以下异常:

[javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-localhost/127.0.0.1:8080-1) /example/pages/common/myPage.xhtml @93,29 scrollListener="#{aBean.handleScrollPage()}": Method not found: example.pagecode.ABean$Proxy$_$$_WeldSubclass@1cf00a1.handleScrollPage(): javax.el.MethodNotFoundException: example/pages/common/myPage.xhtml @93,29 scrollListener="#{aBean.handleScrollPage()}": Method not found: example.ABean$Proxy$_$$_WeldSubclass@1cf00a1.handleScrollPage()
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109) [jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
    at org.richfaces.taglib.MethodExpressionScrollListener.processDataScroll(MethodExpressionScrollListener.java:27) [richfaces-components-ui-4.2.0.Final.jar:4.2.0.Final]
    at org.richfaces.event.DataScrollEvent.processListener(DataScrollEvent.java:83) [richfaces-components-api-4.2.0.Final.jar:4.2.0.Final]
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769) [jboss-jsf-api_2.1_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]
    at org.richfaces.component.AbstractDataScroller.broadcast(AbstractDataScroller.java:166) [richfaces-components-ui-4.2.0.Final.jar:4.2.0.Final]
    at org.richfaces.component.RowKeyContextEventWrapper.broadcast(RowKeyContextEventWrapper.java:104) [richfaces-components-ui-4.2.0.Final.jar:4.2.0.Final]
    at org.richfaces.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:455) [richfaces-components-ui-4.2.0.Final.jar:4.2.0.Final]
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) [jboss-jsf-api_2.1_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) [jboss-jsf-api_2.1_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.7-redhat-1.jar:2.1.7-redhat-1]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.16.Final-redhat-1.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.16.Final-redhat-1.jar:]
    .....

关于什么可能是错误的任何提示?非常感谢!

4

1 回答 1

1

我以前没有见过这个,我无法解释原因,但我敢打赌这是 JBoss 7 EL 实现中的一个错误。作为第一步,我会尝试从方法中删除那些不必要的括号,

scrollListener="#{aBean.handleScrollPage()}" 

使它变成

scrollListener="#{aBean.handleScrollPage}" 

(正如问题评论中所证实的那样,这已经为您解决了问题,也许这与此侦听器方法可选地接受一个参数并且 RichFaces 可能隐含地提供了一个参数有关)

为了完整起见,我建议将此问题报告给 JBoss 人员。

于 2012-09-10T16:43:31.547 回答