This question already has answers here:
*.xhtml url-pattern causes java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading
(2个答案)
5年前关闭。
我正在使用JSF-2.1.2在apache-tomcat-7.0.16中运行我的应用程序。在faces-config.xml中添加导航规则之后,我得到了NullPointerException。此错误已在JSF论坛中提出。 JSF和tomcat应用服务器之间是否有任何兼容版本,或对此有任何解决方案?错误堆栈跟踪如下所示:
但是得到了
java.lang.NoClassDefFoundError:javax/servlet/jsp/jSTL/core/Config
只是在尝试添加对jSTL的依赖项之后,我得到了NullPointerException。回滚到JSF 2.0.9之后,我还删除了对jSTL的依赖。
(2个答案)
5年前关闭。
我正在使用JSF-2.1.2在apache-tomcat-7.0.16中运行我的应用程序。在faces-config.xml中添加导航规则之后,我得到了NullPointerException。此错误已在JSF论坛中提出。 JSF和tomcat应用服务器之间是否有任何兼容版本,或对此有任何解决方案?错误堆栈跟踪如下所示:
java.lang.NullPointerException
at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading(ELFlash.java:793)
at com.sun.faces.context.flash.ELFlash.getPhaseMapForReading(ELFlash.java:826)
at com.sun.faces.context.flash.ELFlash.isEmpty(ELFlash.java:484)
at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:325)
at com.sun.faces.facelets.util.DevTools.writeVariables(DevTools.java:215)
at com.sun.faces.facelets.util.DevTools.debugHtml(DevTools.java:130)
at com.sun.faces.renderkit.RenderKitUtils.renderHtmlErrorPage(RenderKitUtils.java:1159)
at com.sun.faces.context.ExceptionHandlerImpl.throwIt(ExceptionHandlerImpl.java:269)
at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:141)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
最佳答案
Tomcat 7.0.26和JSF 2.1.7的相同问题。与JSF 2.0.9一起使用
最初刚配置
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
但是得到了
java.lang.NoClassDefFoundError:javax/servlet/jsp/jSTL/core/Config
只是在尝试添加对jSTL的依赖项之后,我得到了NullPointerException。回滚到JSF 2.0.9之后,我还删除了对jSTL的依赖。
关于jsf-2 - com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading上的java.lang.NullPointerException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7008507/
10-14 07:21