使用OmniFaces时的NullPointerException:printStackTrace

时间:2012-10-11 17:16:09

标签: jsf omnifaces

我正在使用OmniFaces显示一个漂亮而详细的错误页面,就像展示中的this one一样。

这是我的错误页面:

<ui:composition template="#{erroMB.layout}">
    <ui:define name="conteudo">
        <p:panel collapsed="true" toggleable="true"
            header="Desculpe-nos, um erro ocorreu.">
            <ul style="font-size: 1em; margin-left: 10px;">
                <li>Date/time: #{of:formatDate(now, 'yyyy-MM-dd HH:mm:ss')}</li>
                <li>User agent: #{header['user-agent']}</li>
                <li>User IP: #{request.remoteAddr}</li>
                <li>Request URI: #requestScope['javax.servlet.error.request_uri']}</li>
                <li>Ajax request: #{facesContext.partialViewContext.ajaxRequest ? 'Sim' : 'Não'}</li>
                <li>Status code: #{requestScope['javax.servlet.error.status_code']}</li>
                <li>Exception type: #{requestScope['javax.servlet.error.exception_type']}</li>
                <li>Exception message: #{requestScope['javax.servlet.error.message']}</li>
                <li>Stack trace: <pre>#{of:printStackTrace(requestScope['javax.servlet.error.exception'])}</pre>
                </li>
            </ul>
        </p:panel>
        <h:outputScript rendered="#{facesContext.partialViewContext.ajaxRequest}">scrollTo(0, 0);</h:outputScript>

        <br />
        <h:form>
            <p:commandButton value="Voltar para Início"
                action="#{navegacaoPesquisaMB.irPesquisa()}" ajax="false"
                style="width: 100%;" />
        </h:form>
    </ui:define>
</ui:composition> 

页面呈现得很好,但是当我点击页面末尾的p:commandButton时,我在of:printStackTrace得到一个NullPointerException。我无法理解为什么会发生这种情况,因为函数已被调用并打印出结果。当我点击另一个形式内的按钮时,我无法理解为什么JSF会再次尝试调用该函数,甚至更奇怪。

单击commandButton时的完整堆栈跟踪:

14:00:57,404 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--0.0.0.0-8080-4) Error Rendering View[/erro.xhtml]: javax.el.ELException: /erro.xhtml: Problems calling function 'of:printStackTrace'
    at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:88) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:52) [primefaces-3.4.jar:]
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:198) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:115) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:55) [primefaces-3.4.jar:]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:424) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) [primefaces-3.4.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at br.ind.seat.pso.filtros.FiltroUrlPattern.doFilter(FiltroUrlPattern.java:50) [classes:]
    at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75) [omnifaces-1.1.jar:1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at br.ind.seat.pso.filtros.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:22) [classes:]
    at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75) [omnifaces-1.1.jar:1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_07]
Caused by: java.lang.NullPointerException
    at org.omnifaces.el.functions.Converters.printStackTrace(Converters.java:97) [omnifaces-1.1.jar:1.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_07]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at org.apache.el.parser.AstFunction.getValue(AstFunction.java:112) [jbossweb-7.0.13.Final.jar:]
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    ... 51 more

14:00:57,410 WARN  [org.jboss.solder.exception.control.log] (http--0.0.0.0-8080-4) No handlers found for exception javax.el.ELException: /erro.xhtml: Problems calling function 'of:printStackTrace'
14:00:57,411 WARN  [org.jboss.solder.exception.control.log] (http--0.0.0.0-8080-4) No handlers found for exception javax.servlet.ServletException
14:00:57,412 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/pso].[Faces Servlet]] (http--0.0.0.0-8080-4) Servlet.service() for servlet Faces Servlet threw exception: javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_07]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_07]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_07]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_07]
    at java.lang.Class.newInstance0(Unknown Source) [rt.jar:1.7.0_07]
    at java.lang.Class.newInstance(Unknown Source) [rt.jar:1.7.0_07]
    at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:343) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:173) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:340) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:33) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:73) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:162) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:569) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:559) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:554) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:74) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at br.ind.seat.pso.filtros.FiltroUrlPattern.doFilter(FiltroUrlPattern.java:50) [classes:]
    at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75) [omnifaces-1.1.jar:1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at br.ind.seat.pso.filtros.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:22) [classes:]
    at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75) [omnifaces-1.1.jar:1.1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_07]
Caused by: javax.servlet.ServletException
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) [primefaces-3.4.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Final.jar:3.1.0.Final]
    ... 24 more
Caused by: java.lang.NullPointerException
    at org.omnifaces.el.functions.Converters.printStackTrace(Converters.java:97) [omnifaces-1.1.jar:1.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_07]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_07]
    at org.apache.el.parser.AstFunction.getValue(AstFunction.java:112) [jbossweb-7.0.13.Final.jar:]
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:52) [primefaces-3.4.jar:]
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:198) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:115) [primefaces-3.4.jar:]
    at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:55) [primefaces-3.4.jar:]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:424) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [javax.faces-2.1.9.jar:2.1.9-SNAPSHOT]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    ... 33 more

1 个答案:

答案 0 :(得分:2)

根据堆栈跟踪,表单显然是同步提交给self,因此页面被重新显示,因此所有EL表达式都会被再次评估,但该范围内的异常不再可用。

也许您想删除ajax="false"并仅更新真正需要更新的部分,或者您可能实际上应该导航到目标页面?

<p:button value="Voltar para Início" outcome="/pesquisa.xhtml" style="width: 100%;" />

NullPointerException反过来确实是of:printStackTrace()中的错误。自OmniFaces版本1.2以来它已得到修复。