升级到JSF 2.1.19后,类型UIViewRoot的方法getViewMap()未定义

时间:2014-08-19 17:23:52

标签: jsf richfaces

我有一个使用JSF 2.0.11和RichFaces 4.3.4的应用程序。我尝试升级到JSF 2.1.19并开始获得以下异常。它似乎没有意义,因为应用程序构建良好

java.lang.RuntimeException: javax.servlet.ServletException: java.lang.Error: Unresolved compilation problems: 
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot

    gov.gsa.pbs.rexus.common.webtier.RexusSecFilter.doFilter(RexusSecFilter.java:218)
    org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:149)
    org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)



root cause 
javax.servlet.ServletException: java.lang.Error: Unresolved compilation problems: 
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot

    javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
    gov.gsa.pbs.rexus.common.webtier.RexusSecFilter.doFilter(RexusSecFilter.java:209)
    org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:149)
    org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)



root cause 
javax.faces.el.EvaluationException: java.lang.Error: Unresolved compilation problems: 
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot
    The method getViewMap() is undefined for the type UIViewRoot

    javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
    javax.faces.component.UICommand.broadcast(UICommand.java:315)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    gov.gsa.pbs.rexus.common.webtier.RexusSecFilter.doFilter(RexusSecFilter.java:209)
    org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:149)
    org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)

1 个答案:

答案 0 :(得分:0)

此异常表明运行时类路径包含JSF 1.x API以及JSF 2.x impl。该方法在JSF 2.0 API中确实是introduced,并且在任何JSF 1.x API中都不存在。

清理运行时类路径以摆脱那些JSF 1.x API库。通常,它们具有文件名jsf-api.jar。如有必要,请将JSF 2.1.19兼容的API放在适当的位置。如果您使用单个javax.faces-2.1.19.jar文件,则不应该这样做。

如果徒劳无功,请详细说明您正在使用哪个servletcontainer impl / version以及哪些文件都存在于构建的WAR文件的/WEB-INF/lib文件夹中。