4

我想在我的项目中使用一些 HTML5 标签,所以我想将我的 JSF 版本更新为支持 HTML5 标签的 2.2。目前我正在使用Eclipse 下载的 JSF 库,Eclipse 版本:Juno Service Release 2。

我阅读了很多关于如何像这样执行更新的不同说明。

我经历的步骤: 我下载了jsf-impl-2.2.0-m05.jarjsf-api-2.2.0-m05.jar把它们移到WEB-INF/lib了我的项目中。

然后我转到 Properties/Project Facets/Java Server Faces 并单击 User Libraries,然后我添加了一个名为“JSF 2.2”的“新”,我添加了我lib之前下载的两个 jar。添加这些后,我将返回用户库屏幕,但无法单击“应用”,因为它告诉我:

Required class javax.faces.FactoryFinder does not exist in selected libraries.

我正在使用这个faces-config.xmlhttps ://stackoverflow.com/a/16131589/989919

不知何故我搞砸了,现在我只看到一个:

HTTP Status 404
description The requested resource is not available.

如果我尝试访问我的 index.xhtml。

当我使用下载的 2.0 版本的 Eclipse 时,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

谢谢!

4

2 回答 2

0

可能在 java build path->order 和 export 选项卡上向上移动你的库。以 maven 项目为例,您需要上移 maven 依赖项或下移 JSF 库

于 2015-01-17T09:03:16.477 回答
0

你的罐子在构建路径中吗?签入eclipse,在当前项目中右击,进入properties->java build path->libraries。

于 2014-10-21T18:24:19.507 回答