在升级到JSF 2.1.19之后,对于UIViewRoot类型,getViewMap()方法是未定义的



我有一个使用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)

此异常表明运行时类路径包含JSF 1。x API以及JSF 2。x impl。该方法确实是在JSF 2.0 API中引入的,但在任何JSF 1中都没有。

x的API。

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

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

最新更新