Weblogic 9.2.1上的RichFaces

时间:2011-05-16 17:45:47

标签: 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上的libs,并且libs是正确的。 我认为这个问题是由Weblogic的库JSF发生的。

2 个答案:

答案 0 :(得分:4)

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

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

因此,无论如何,JSF 2.0都无法在Weblogic 9.2.x上运行。您有两个选择:

  1. 将容器升级到支持Servlet 2.5的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.使用Facelets而不是JSP时,它应该适用于Servlet 2.4。
  3. 你可以理论但是用特定的lib破解你的JSF 2.0 webapp,让它在servlet 2.4容器上运行。我不保证它会与RichFaces一起在Weblogic上完美运行。

答案 1 :(得分:0)

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

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