gpt4 book ai didi

java - JSF 1.2、Richfaces 3.X 和 Jboss 服务器 5.0 : After Adding Richfaces JAR it's giving Error

转载 作者:行者123 更新时间:2023-12-01 14:27:08 41 4
gpt4 key购买 nike

简单的 JSF1.2 和 Jboss Server 5.0 工作正常,但添加 Richfaces 3.X JAR 后出现错误。我的应用程序无法运行。

Richfaces jar

  • richfaces-api-3.3.2.SR1.jar
  • richfaces-impl-3.3.2.SR1.jar
  • richfaces-ui-3.3.2.SR1.jar

请检查下面的错误日志并请帮忙解决。

java.lang.ClassNotFoundException: org.ajax4jsf.Filter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:240)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:220)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:332)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:90)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3783)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4413)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy36.start(Unknown Source)

包含包结构和 web.xml 的屏幕截图

enter image description here

请帮我解决这个问题..

最佳答案

  1. 默认情况下,JBoss 5.0 在以下位置包含 JSF 库:jboss-5.0.0.GA\server\default\deploy\jbossweb.sar\jsf-libs。如果实现需要,您必须在此位置明确提供 JSF 2.0。

    • jboss-faces.jar
    • jsf-api.jar
    • jsf-impl.jar
  2. 此外,您必须在项目部署期间提供所需的 JSF 实现特定的 jar。下面是\WEB-INF\lib内容。

    • cssparser-0.9.5.jar
    • Guava -13.0.1.jar
    • richfaces-components-api-4.3.2.Final.jar
    • richfaces-components-ui-4.3.2.CR1.jar
    • richfaces-core-api-4.3.2.Final.jar
    • richfaces-core-impl-4.3.2.Final.jar
    • sac-1.3.jar
  3. 更改 web.xml 内容中的命名空间声明架构位置

    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

    此外,删除过滤器/过滤器映射并添加以下内容。

      <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>

    <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
    </context-param>

    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>

[注意:我已经使用 RichFaces 4.3.2、JBoss 5.0 和 JSF 2.0 进行了验证。我认为它应该适用于较低的配置]

关于java - JSF 1.2、Richfaces 3.X 和 Jboss 服务器 5.0 : After Adding Richfaces JAR it's giving Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17123210/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com