我想在我的项目中使用一些HTML5标签,所以我想将我的JSF版本更新为支持HTML5标签的2.2版本。目前我正在使用Eclipse版本的JSF库Eclipse downloads itself:Juno Service Release 2。
我阅读了很多关于如何执行更新的不同说明,例如this。
我完成的步骤:
我下载了jsf-impl-2.2.0-m05.jar
和jsf-api-2.2.0-m05.jar
,并将其移至我项目的WEB-INF/lib
。
然后我去了Properties / Project Facets / Java Server Faces并点击了User Libraries,然后我添加了一个名为“JSF 2.2”的“New”,我添加了我之前下载到lib
的两个jar 。一旦我添加了这些,我就会回到用户库屏幕,但我无法点击“应用”,因为它告诉我:
Required class javax.faces.FactoryFinder does not exist in selected libraries.
我正在使用此faces-config.xml
:https://stackoverflow.com/a/16131589/989919
不知怎的,我搞砸了,现在我只是看到了:
HTTP Status 404
description The requested resource is not available.
如果我尝试访问我的index.xhtml。
当我使用Eclipse下载的2.0版本时,Eclipse控制台中有错误消息。
Jun 23, 2013 9:52:54 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
Jun 23, 2013 9:52:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.ClassNotFoundException: org.apache.myfaces.webapp.StartupServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4823)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
Jun 23, 2013 9:52:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Jun 23, 2013 9:52:54 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
和
Jun 23, 2013 9:52:55 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-api in version : 2.0.2 from path : file:/Users/mediocre/Documents/Developement/Eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/WebEng_07/WEB-INF/lib/myfaces-api-2.0.2.jar
Jun 23, 2013 9:52:55 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: Starting up MyFaces-package : myfaces-impl in version : 2.0.2 from path : file:/Users/mediocre/Documents/Developement/Eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/WebEng_07/WEB-INF/lib/myfaces-impl-2.0.2.jar
Jun 23, 2013 9:52:55 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk not found.
Jun 23, 2013 9:52:55 PM org.apache.myfaces.config.FacesConfigurator startLib
INFO: MyFaces-package : tomahawk12 not found.
Jun 23, 2013 9:52:55 PM org.apache.myfaces.config.FacesConfigurator startLib
谢谢!
答案 0 :(得分:0)
您的罐子是否在构建路径中? 检查eclipse,右键单击当前项目并转到properties-> java build path-> libraries。
答案 1 :(得分:0)
可能在java build path-> order and export选项卡上移动你的库。 以maven项目为例,您需要提升maven依赖关系或向下移动JSF Librairies