2011-03-31 63 views
0

我的應用程序使用JSF 2和Richfaces 3.3.3,而mojarra 2.0.2在Glassfish 3.1上正常工作,但是每當我將它移植到Tomcat 7.0.10上,每次我遇到一個或另一個問題。 它從未能檢測到jsf_core.tld開始,隨後是一些JSF呈現問題,最後是這一問題。 最後,我發現了一些我在這裏提到的,而我找不到解決方法。java.lang.NoClassDefFoundError:org/ajax4jsf/resource/InternetResourceBuilder

Mar 31, 2011 8:57:52 PM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener 
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder 
     at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:294) 
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4651) 
     at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5154) 
     at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5149) 
     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) 
     at java.lang.Thread.run(Thread.java:619) 
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder 
     at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:357) 
     at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:226) 
     ... 8 more 
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder 
     at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62) 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
     at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:586) 
     at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:472) 
     at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) 
     at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:796) 
     at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) 
     at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:294) 
     at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:213) 
     at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:338) 
     ... 9 more 

回答

0

從例外似乎無法找到Richfaces。將jar放入類路徑中(對於Tomcat WEB-INF/lib或WEB-INF/classes)並重試。

+0

我是堅定的,所有這些罐子都在我的類路徑(RichFaces的 - implement執行-jsf2.3.3.3.Final.jar,RichFaces的-UI-3.3.3.Final.jar,richfaces-api-3.3.3.Final .jar),然後這些問題即將到來。 (我在WAR內部潛入並在web-inf/lib文件夾中發現了所有這些jar) – 2011-03-31 18:58:43

+0

您是否也在tomcat的部署文件夾中找到它? – 2011-04-01 06:16:04

1

你已經實現了一套JAR文件RichFaces的,但不是在運行時類路徑RichFaces的API JAR。

的堆棧跟蹤是這方面的證據:

Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder 
    at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62) 

at org.ajax4jsf.renderkit.ChameleonRenderKitFactory該行表示這個特定的類被成功加載和執行(否則將不顯示瞭如在堆棧跟蹤一個at xxx在所有)。這個類是RichFaces impl JAR文件的一部分。 InternetResourceBuilder又是RichFaces API JAR文件的一部分。這在運行時類路徑中顯然缺少。至少,這正是例外情況告訴我們的。