实现PrimeFaces扩展时出错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了实现PrimeFaces扩展时出错相关的知识,希望对你有一定的参考价值。

我是primefaces的新手,并尝试实现primefaces扩展。根据指南,我将以下jar添加到我的构建路径:1)commons-lang3-3.1.jar 2)gson-2.3.1.jar 3)primefaces-5.0.jar 4)primefaces-5.0-sources.jar 5) primefaces的扩展-3.2.0.jar

我按照这里的建议创建了一个xhtml和托管bean:http://www.primefaces.org/showcase-ext/sections/timeline/basic.jsf

以下是相同的错误日志:

Jun 25, 2015 4:07:05 PM com.sun.faces.context.ExceptionHandlerImpl log
1100: org.primefaces.util.ComponentUtils.resolveWidgetVar(Ljavax/faces/context/FacesContext;Lorg/primefaces/component/api/Widget;)Ljava/lang/String;
java.lang.NoSuchMethodError: org.primefaces.util.ComponentUtils.resolveWidgetVar(Ljavax/faces/context/FacesContext;Lorg/primefaces/component/api/Widget;)Ljava/lang/String;
    at org.primefaces.extensions.component.timeline.Timeline.resolveWidgetVar(Timeline.java:713)
    at org.primefaces.extensions.component.timeline.TimelineTagHandler.onComponentPopulated(TimelineTagHandler.java:58)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:218)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87)
    at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:990)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.tcs.its.permission.filter.LoginFilter.doFilter(LoginFilter.java:58)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
答案

这是由于使用了PF和PFE的错误组合...使用PF5,你只能使用PFE 2.0 / 2.1。在谷歌中搜索堆栈跟踪中的错误会告诉你如此

也可以看看

以上是关于实现PrimeFaces扩展时出错的主要内容,如果未能解决你的问题,请参考以下文章

在片段中创建自定义列表视图时出错。必需的活动,找到的片段

使用片段从数据库 SQLite 获取数据时出错

在我的“设置”片段中膨胀类 PreferenceScreen 时出错

第二次在对话框中膨胀片段时出错

Android:在drawerlayout中使用地图膨胀片段时出错

在片段中创建自定义列表视图时出错所需活动,找到片段