java - Weblogic 9.2.1 上的 RichFaces

标签 java jsf richfaces weblogic

我尝试在 Weblogic 9.2.1 上部署应用程序,但收到此错误:

org.richfaces.component.html.HtmlSubTable
javax.faces.FacesException: javax.faces.FacesException: Cant instantiate class: org.richfaces.component.html.HtmlSubTable.
        at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:545)
        at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1302)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:397)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:376)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        Truncated. see log file for complete stacktrace
javax.faces.FacesException: Cant instantiate class: org.richfaces.component.html.HtmlSubTable.
        at com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1016)
        at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:539)
        at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1302)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:397)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:376)
        Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: javax/faces/component/visit/VisitContext
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
        at java.lang.Class.getDeclaredMethods(Class.java:1763)
        at java.beans.Introspector$1.run(Introspector.java:1265)
        at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
        Truncated. see log file for complete stacktrace

我尝试了很多方法来解决这个问题,但到目前为止我还不明白这个问题。我在 WEB-INF/lib 上检查了我的库,库是正确的。 我认为这个问题是由于 Weblogic 的库 JSF 而发生的。

最佳答案

java.lang.NoClassDefFoundError: javax/faces/component/visit/VisitContext

这是 JSF 2.0 specific这反过来又需要一个 Servlet 2.5 容器,其中 web.xml 声明符合 Servlet 2.5 规范。我不做 Weblogic,所以我不能从头上说出来,但谷歌告诉我 Weblogic 9.2.x 是一个 Servlet 2.4 容器。

因此,无论如何,JSF 2.0 都无法在开箱即用的 Weblogic 9.2.x 上运行。您有 2 个选择:

  1. 将容器升级到支持 Servlet 2.5 的品牌/版本。例如。 Weblogic 10.x、Glassfish 2.x、JBoss AS 5.x、Tomcat 6.x 等。Servlet 2.5 已在 5 年前推出。
  2. 将 JSF 2.0 降级为 JSF 1.2,将 RichFaces 4.x 降级为 RichFaces 3.x。使用 Facelets 时它应该可以在 Servlet 2.4 上运行,而不是 JSP。

理论上您可以使用特定的库破解您的 JSF 2.0 web 应用程序,使其在 servlet 2.4 容器上运行。我只是不保证它能与 RichFaces 一起在 Weblogic 上完美运行。

关于java - Weblogic 9.2.1 上的 RichFaces,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6021231/

相关文章:

java - 从 Android 中的 Assets 传递路径

java - 如何在 JSF 中下载 XML 动态生成的文件?

jsf - 在 panelGrid 列中对齐内容

java - 在 JBoss 中配置电子邮件 - JNDI 资源未获得正确的配置

java - 用图像网格填充屏幕的最佳方法

javascript - 如何在p :message of primefaces中打印javascript警报消息

css - JSF1005 : Cannot instantiate validator of type javax. faces.Bean

java - javascript 中的城市/地址搜索自动完成

java - Apache POI XWPF 添加形状到标题

jsf - 分页不适用于带过滤器的 Primefaces 数据表(仅限第一次)