配置RichFaces:java.lang.ClassNotFoundException:org.ajax4jsf.Filter [英] Configuring for RichFaces: java.lang.ClassNotFoundException: org.ajax4jsf.Filter

查看:98
本文介绍了配置RichFaces:java.lang.ClassNotFoundException:org.ajax4jsf.Filter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含一些RichFaces组件的项目. 除了RichFaces之外,其他所有组件都会显示.

I have a project that contains some RichFaces components. All other components get displayed but the RichFaces.

从服务器日志中我得到:

From the server logs I get:

java.lang.ClassNotFoundException:org.ajax4jsf.Filter

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

I am aware that with RichFaces 4.0 no filters are needed in the Web.xml.

这是我的图书馆:

  1. commons-beanutils-1.7.0.jar
  2. commons-collections-3.2.jar
  3. commons-digester-1.8.jar
  4. commons-digester.jar
  5. commons-discovery.jar
  6. commons-logging-1.0.4.jar
  7. cssparser-0.9.5.jar
  8. guava-r08.jar
  9. jhighlight-1.0.jar
  10. jsf-api.jar
  11. jsf-facelets.jar
  12. jsf-impl.jar
  13. richfaces-components-api-4.0.0.Final.jar
  14. richfaces-components-ui-4.0.0.Final.jar
  15. richfaces-core-api-4.0.0.Final.jar
  16. richfaces-core-impl-4.0.0.Final.jar
  17. sac-1.3.jar
  1. commons-beanutils-1.7.0.jar
  2. commons-collections-3.2.jar
  3. commons-digester-1.8.jar
  4. commons-digester.jar
  5. commons-discovery.jar
  6. commons-logging-1.0.4.jar
  7. cssparser-0.9.5.jar
  8. guava-r08.jar
  9. jhighlight-1.0.jar
  10. jsf-api.jar
  11. jsf-facelets.jar
  12. jsf-impl.jar
  13. richfaces-components-api-4.0.0.Final.jar
  14. richfaces-components-ui-4.0.0.Final.jar
  15. richfaces-core-api-4.0.0.Final.jar
  16. richfaces-core-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>

我正在使用GlassFish服务器3.1.1

I am using GlassFish server 3.1.1

我尝试了不同的配置,还尝试包含ajax4jsf.jar.但是总是以相同的错误结束.任何帮助,我们将不胜感激.

I have tried different configurations, also tried to include ajax4jsf.jar. But always ended up with the same error. Any help is greatly appreciated.

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

the complete server log is shown here:

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)

推荐答案

从库中删除jsf*.jar. Glassfish3已经提供了JSF 2.x库.同样,jsf-facelets.jar是JSF 1.x的Facelets1.x. JSF 2.x库已经包含Facelets 2.x.

Remove jsf*.jar from your libraries. The JSF 2.x libs are already provided by Glassfish3. Also, jsf-facelets.jar is of Facelets 1.x for JSF 1.x. The JSF 2.x libs already include Facelets 2.x.

关于例外情况,只需从web.xml中删除org.ajax4jsf.Filter<filter>.这来自RichFaces 3.x,在RichFaces 4.x中不再需要.确保您正在阅读 RichFaces 4.x RichFaces 3.x .

As to the exception, just remove <filter> of org.ajax4jsf.Filter from web.xml. This is from RichFaces 3.x and not necessary anymore in RichFaces 4.x. Make sure that you're reading developer documentation for RichFaces 4.x and not RichFaces 3.x.

这篇关于配置RichFaces:java.lang.ClassNotFoundException:org.ajax4jsf.Filter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆