当ViewExpiredException发生未显示JSF页面错误(JSF Error page n

2019-10-17 19:07发布

我有以下错误,当一个页面中查看已过期。 有消息称,该Error page '/home.xhtml' will be shown. 但实际上什么也看不见了,该页面是一样的,它只是冻结。 我使用FullAjaxExceptionHandlerOmnifaces,通过描述balusC 。

我使用Primefaces 3.5和钻嘴鱼科2.1.17。

Mär 11, 2013 1:40:30 PM org.apache.catalina.core.ApplicationContext log
SEVERE: FullAjaxExceptionHandlerx: An exception occurred during processing JSF ajax request. Error page '/home.xhtml' will be shown.
javax.faces.application.ViewExpiredException: viewId:/wishes_book.xhtml - View /wishes_book.xhtml could not be restored.
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    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:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    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:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Mär 11, 2013 1:40:30 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
SEVERE: Error Rendering View[/home.xhtml]
java.lang.NullPointerException
    at org.primefaces.renderkit.CoreRenderer.getWidgetBuilder(CoreRenderer.java:481)
    at org.primefaces.component.menubar.MenubarRenderer.encodeScript(MenubarRenderer.java:36)
    at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:40)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeRow(PanelGridRenderer.java:143)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeStaticBody(PanelGridRenderer.java:107)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeBody(PanelGridRenderer.java:63)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:49)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeRow(PanelGridRenderer.java:143)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeStaticBody(PanelGridRenderer.java:107)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeBody(PanelGridRenderer.java:63)
    at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:49)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
    at com.sun.faces.context.PartialViewContextImpl.renderAll(PartialViewContextImpl.java:404)
    at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:289)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:982)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:411)
    at com.meinanliegen.handlers.exceptions.FullAjaxExceptionHandler.renderErrorPageView(FullAjaxExceptionHandler.java:231)
    at com.meinanliegen.handlers.exceptions.FullAjaxExceptionHandler.handleAjaxException(FullAjaxExceptionHandler.java:200)
    at com.meinanliegen.handlers.exceptions.FullAjaxExceptionHandler.handle(FullAjaxExceptionHandler.java:145)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    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:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    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:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Mär 11, 2013 1:40:30 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/MeinAnliegen] threw exception

能否请你帮我一个建议,我怎么能解决他的问题?

Answer 1:

这是由PrimeFaces 3.5造成的。 他们增加了一个PhaseListener创建并提出一个WidgetBuilder渲染阶段期间上下文属性。 该FullAjaxExceptionHandler但是强制直接在不用时渲染阶段但当前阶段渲染。 这引起了WidgetBuildernull PrimeFaces部件的编码,因此该期间NPE。 此外,在当前阶段是渲染响应的话,那就还是不行,因为FullAjaxExceptionHandler渲染(与唯一原因,迫使JSF资源依赖的重注如CSS / JS文件之前有点太agressively清除整个上下文属性映射),包括PrimeFaces WidgetBuilder

该报告为OmniFaces问题120 。 所述FullAjaxExceptionHandler提高到呈现委托给JSF当当前没有呈现响应阶段,并且仅除去从上下文属性地图的特定属性。 您需要更新OmniFaces到至少1.4(这是目前1.4.1),以得到它的工作。



文章来源: JSF Error page not shown when ViewExpiredException occurs