【问题标题】:JSF: "scrollListener" method not found after switching from JBoss 6 to JBoss 7JSF:从 JBoss 6 切换到 JBoss 7 后找不到“scrollListener”方法
【发布时间】:2012-09-03 13:23:41
【问题描述】:

我有一个包含以下代码的 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:]
    .....

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

【问题讨论】:

  • 尝试删除那些不必要的括号。也许它扼杀了 JBoss 7 的 EL 实现。
  • 嗨,BalusC!非常感谢,就是这样! :) 如果您愿意,可以正式回答我,我将问题标记为已回答! :) 再见

标签: jsf-2 richfaces jboss7.x


【解决方案1】:

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

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

这样就变成了

scrollListener="#{aBean.handleScrollPage}" 

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

为了完整起见,我建议 report 这个问题给 JBoss 人。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    • 1970-01-01
    • 2012-07-31
    • 1970-01-01
    • 2014-07-16
    • 2014-03-05
    相关资源
    最近更新 更多