我有一个在Tomcat 7.0.4服务器上工作的现有JSF 2.0项目。我正在尝试将Icefaces 2.0.0 Beta2添加到该项目中。我从Icefaces官方主页下载了文件ICEfaces-2.0.0-Beta2-bin.zip,并按照here中所述的说明进行操作。

我将4个文件icefaces.jaricepush.jaricefaces-ace.jaricefaces-compat.jarICEfaces-2.0.0-Beta2-bin/icefaces/lib目录复制到了WEB-INF/lib目录(该文件包含了我所有的jar)。 jsf-api.jarjsf-impl.jar已经包含在我的项目中,因此没有被复制。

将Web应用程序部署到Tomcat 7服务器时,发生以下错误:

/home/user > ant deploy reload

Buildfile: build.xml

build:

deploy:

reload:
   [reload] FAIL - Encountered exception java.lang.IllegalStateException: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/wtree-www] has not been started

BUILD FAILED
FAIL - Encountered exception java.lang.IllegalStateException: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/wtree-www] has not been started

Total time: 0 seconds


这是来自catalina.log的,我认为这可能很有趣:

INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
Nov 2, 2010 10:04:42 PM org.icepush.servlet.MainServlet <init>
INFO:
ICEsoft Technologies Inc.
ICEpush 2.0.0 Beta2
Build number: 13
Revision: 22877

Nov 2, 2010 10:04:43 PM org.icefaces.util.EnvConfig init
INFO: ICEfaces Configuration:
org.icefaces.render.auto: true [default]
org.icefaces.autoid: true [default]
org.icefaces.aria.enabled: true [default]
org.icefaces.blockUIOnSubmit: false [default]
org.icefaces.compressDOM: false [default]
org.icefaces.compressResources: true [default]
org.icefaces.connectionLostRedirectURI: null [default]
org.icefaces.deltaSubmit: false [default]
org.icefaces.lazyPush: true [default]
org.icefaces.sessionExpiredRedirectURI: null [default]
org.icefaces.standardFormSerialization: false [default]
org.icefaces.strictSessionTimeout: false [default]
org.icefaces.windowScopeExpiration = 1000 [default]
Nov 2, 2010 10:04:43 PM org.icefaces.impl.renderkit.DOMRenderKit <clinit>
INFO:
ICEsoft Technologies Inc.
ICEfaces 2.0.0 Beta2
Build number: 003
Revision: 22976

Nov 2, 2010 10:04:43 PM com.sun.faces.config.ConfigManager initialize
INFO: Unsanitized stacktrace from failed start...
com.sun.faces.config.ConfigurationException:
  Source Document: jar:file:/opt/apache-tomcat-7.0.4/webapps/wtree-www/WEB-INF/lib/icefaces-compat.jar!/META-INF/faces-config.xml
  Cause: Class 'com.icesoft.faces.component.effect.ApplyEffectRenderer' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
 at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:275)
 at com.sun.faces.config.processor.RenderKitConfigProcessor.addRenderers(RenderKitConfigProcessor.java:309)
 at com.sun.faces.config.processor.RenderKitConfigProcessor.process(RenderKitConfigProcessor.java:175)
 at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)
 at com.sun.faces.config.processor.ManagedBeanConfigProcessor.process(ManagedBeanConfigProcessor.java:266)
 at com.su .....
......
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
 at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.<clinit>(DomBasicRenderer.java:61)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
.....
Nov 2, 2010 10:04:43 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Nov 2, 2010 10:04:43 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/wtree-www] startup failed due to previous errors


我不明白如何复制这4个文件会产生此错误。我什么都没做您能帮我吗?

最佳答案

像往常一样,异常stacktrace的caused by部分讲述了问题的根本原因。您的情况如下:

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory


这是不言自明的。运行时类路径中缺少提到的类。将commons-logging.jar添加到/WEB-INF/lib,此特定问题应解决。如果您还没有其他地方(也许在IceFaces下载中?),则可以在http://commons.apache.org/logging处获得它。

10-08 13:06