从JSF 1.2迁移到JSF 2.0之后,UIComponentBase中的NPE#getRenderer()

时间:2011-02-09 18:30:29

标签: jsf jsf-2 richfaces

我将我的Web应用程序从JSF 1.2迁移到JSF 2.0。在先前版本中工作的注销页面在JSF 2.0中抛出NullPointerException。其余的事情正在按预期运作。

下面是堆栈跟踪:

java.lang.NullPointerException
    at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1268)
    at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:788)
    at org.ajax4jsf.component.AjaxViewRoot$1.invokeRoot(AjaxViewRoot.java:396)
    at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:229)
    at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)

我的logout.xhtml看起来像这样:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
<head>
<meta http-equiv="Refresh" content="0; URL=#{bean.logoutUrl}"></meta>
</head>
<body>
    <p>Logging you out...</p>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

我肯定会升级我的JSF 2版本。前段时间我使用JSF 2.0.2遇到了同样的问题,当升级到JSF 2.0.3时它就消失了。 JSF 2.0.3发行说明中描述了该问题。