配置RichFaces:java.lang.ClassNotFoundException:org.ajax4jsf.Filter

tim*_*sa7 4 jsf web.xml richfaces glassfish-3

我有一个包含一些RichFaces组件的项目.显示所有其他组件但RichFaces.

从我得到的服务器日志:

java.lang.ClassNotFoundException:org.ajax4jsf.Filter

我知道使用RichFaces 4.0时,Web.xml中不需要过滤器.

这是我的图书馆:

  1. 公地的BeanUtils-1.7.0.jar
  2. 公地集合-3.2.jar
  3. 公共沼气池-1.8.jar
  4. 公地digester.jar
  5. 公地discovery.jar
  6. 共享记录-1.0.4.jar
  7. cssparser-0.9.5.jar
  8. 番石榴r08.jar
  9. jhighlight-1.0.jar
  10. JSF-api.jar文件
  11. JSF的facelets.jar
  12. JSF-impl.jar中
  13. RichFaces的组件-API 4.0.0.Final.jar
  14. RichFaces的组件-UI-4.0.0.Final.jar
  15. RichFaces的核心-API 4.0.0.Final.jar
  16. RichFaces的核心 - IMPL-4.0.0.Final.jar
  17. SAC-1.3.jar

这是我的web.xml

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

我正在使用GlassFish服务器3.1.1

我尝试过不同的配置,也尝试包含ajax4jsf.jar.但总是出现同样的错误.任何帮助是极大的赞赏.

完整的服务器日志显示在这里:

0500|SEVERE|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WebModule[/HelloWorld_war_exploded]PWC1270: Exception starting filter richfaces
java.lang.InstantiationException
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:124)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
    at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
    at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
    at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.ClassNotFoundException: org.ajax4jsf.Filter
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
Run Code Online (Sandbox Code Playgroud)

Bal*_*usC 7

jsf*.jar从您的库中删除.在JSF 2.x的库都已经被Glassfish3提供.此外,jsf-facelets.jar是JSF 1.x的Facelets 1.x. JSF 2.x库已经包含Facelets 2.x.

至于例外,只是删除<filter>org.ajax4jsf.Filter距离web.xml.这来自RichFaces 3.x,在RichFaces 4.x中不再需要.确保您正在阅读RichFaces 4.x不是 RichFaces 3.x的开发人员文档.