2

我在一个项目上工作jsf2 springhibernate。当我想将 jsf2 与 spring 集成时,在启动我的 JSF 时出现此错误tomcat7。我有罐子myfaces-impl & api。我搜索了互联网,但直到现在都没有找到解决方案。

Grave: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: com/sun/facelets/tag/TagHandler
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
at com.sun.faces.util.Util.loadClass(Util.java:205)
at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:289)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:365)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:351)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:299)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:248)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:313)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:208)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.facelets.tag.TagHandler
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
... 25 more

网页.xml:

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/application-context.xml</param-value>
</context-param>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<filter>
<filter-name>RichFaces Filter</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>RichFaces Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

面孔-config.xml:

<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
4

2 回答 2

1

您需要添加jsf2库。如果您已添加它,那么它不在您的类路径中。

于 2012-08-03T18:00:05.510 回答
0

在 JSF 2 中使用旧的 facelets jar 没有意义,因为实现捆绑了 facelets VDL。相反,似乎在 JSF 2 应用程序中使用了一些 JSF 1.2 库,这是不对的。如果您使用 JSF 2,只需更新您的库。

于 2012-08-03T18:14:51.603 回答