当前位置: 代码迷 >> VC/MFC >> spring mvc demo里面tomcat启动异常有关问题解决
  详细解决方案

spring mvc demo里面tomcat启动异常有关问题解决

热度:141   发布时间:2016-05-02 03:47:53.0
spring mvc demo里面tomcat启动错误问题解决

环境:

? ? ?eclipse+tomcat 7 +jdk1.8 + spring3.2

问题描述:

? ? 在eclipse中创建dynamic web project项目之后,将下载好的spring jar包通过build path导入之后再把相应的jar包拷贝到WebContent/WEB-INF/lib目录下之后,启动配置好的tomcat7,报如下错误:

? ??严重:?A?child?container?failed?during?start

java.util.concurrent.ExecutionException:?org.apache.catalina.LifecycleException:?Failed?to?start?component?[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springmvc]]
at?java.util.concurrent.FutureTask.report(FutureTask.java:122)
at?java.util.concurrent.FutureTask.get(FutureTask.java:192)
at?org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1122)
at?org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at?org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at?org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at?java.util.concurrent.FutureTask.run(FutureTask.java:266)
at?java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at?java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at?java.lang.Thread.run(Thread.java:745)
Caused?by:?org.apache.catalina.LifecycleException:?Failed?to?start?component?[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springmvc]]
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
...?6?more
Caused?by:?java.lang.NoClassDefFoundError:?Lorg/apache/commons/logging/Log;
at?java.lang.Class.getDeclaredFields0(Native?Method)
at?java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at?java.lang.Class.getDeclaredFields(Class.java:1916)
at?org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at?org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
at?org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)
at?org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
at?org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:415)
at?org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:892)
at?org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
at?org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at?org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at?org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5405)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
...?6?more
Caused?by:?java.lang.ClassNotFoundException:?org.apache.commons.logging.Log
at?org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
at?org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
...?20?more

九月?07,?2015?6:28:07?下午?org.apache.catalina.core.ContainerBase?startInternal
严重:?A?child?container?failed?during?start
java.util.concurrent.ExecutionException:?org.apache.catalina.LifecycleException:?Failed?to?start?component?[StandardEngine[Catalina].StandardHost[localhost]]
at?java.util.concurrent.FutureTask.report(FutureTask.java:122)
at?java.util.concurrent.FutureTask.get(FutureTask.java:192)
at?org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1122)
at?org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at?org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at?org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at?org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at?sun.reflect.NativeMethodAccessorImpl.invoke0(Native?Method)
at?sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at?sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at?java.lang.reflect.Method.invoke(Method.java:497)
at?org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at?org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused?by:?org.apache.catalina.LifecycleException:?Failed?to?start?component?[StandardEngine[Catalina].StandardHost[localhost]]
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at?org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at?org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at?java.util.concurrent.FutureTask.run(FutureTask.java:266)
at?java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at?java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at?java.lang.Thread.run(Thread.java:745)
Caused?by:?org.apache.catalina.LifecycleException:?A?child?container?failed?during?start
at?org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1130)
at?org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
at?org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
...?6?more

以下若干行省略

经过排查和网上查找资料,发现是缺少

commons-logging.jar

的原因,网上另外下载该jar包并拷贝到WebContent/WEB-INF/lib目录下以后tomcat就可以正常启动了。

最后感谢

http://blog.csdn.net/ws_blog/article/details/12709591?reload

http://blog.csdn.net/jovon/article/details/37722573

这两篇文章的作者。