RichFaces on Weblogic 9.2.1



我尝试在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 的,这反过来需要一个 Servlet 2.5 容器,其中web.xml声明符合 Servlet 2.5 规范。我不做Weblogic,所以我无法从头顶上分辨出来,但Google告诉我Weblogic 9.2.x是一个Servlet 2.4容器。

因此,JSF 2.0无论如何都不会在Weblogic 9.2.x上运行。您有 2 个选项:

    将容器升级到支持 Servlet 2.5
  1. 的 make/version。 例如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。当使用 Facelet 而不是 JSP 时,它应该在 Servlet 2.4 上运行。

然而,理论上你可以使用特定的库破解你的JSF 2.0 Web应用程序,让它在servlet 2.4容器上运行。我只是不保证它会在Weblogic和RichFaces上完美运行。

  • 在 Servlet 2.4 容器上运行 JSF 2.0

Cound 是与 WebLogic JAR 的冲突。 要么删除你的类,要么告诉WebLogic更喜欢使用<prefer-web-inf-classes>在WEB-INF/lib中找到的类:

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/classloading.html

最新更新