org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext

时间:2014-11-01 18:50:50

标签: java spring-mvc tomcat

我尝试使用Apache Tomcat 7.0在Spring中创建一个简单的hello world程序。我收到以下错误,服务器进入停止状态。

  

严重:子容器在启动时失败   java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/ PassportParking]]     在java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)     在   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/ PassportParking]]     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     ... 6更多引起:java.lang.NoClassDefFoundError:   org / springframework / core / NestedRuntimeException at   java.lang.ClassLoader.defineClass1(Native Method)at   java.lang.ClassLoader.defineClass(未知来源)at   java.security.SecureClassLoader.defineClass(未知来源)at   org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)     在   org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)     在   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)     在   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)     at java.lang.Class.getDeclaredFields0(Native Method)at   java.lang.Class.privateGetDeclaredFields(未知来源)at   java.lang.Class.getDeclaredFields(未知来源)at   org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)     在   org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)     在   org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)     在   org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)     在   org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:415)     在   org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:892)     在   org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)     在   org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)     在   org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 6更多引起:java.lang.ClassNotFoundException:   org.springframework.core.NestedRuntimeException at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)     在   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)     ......还有27个

     

2014年11月2日上午12:09:30 org.apache.catalina.core.ContainerBase   startInternal SEVERE:启动时子容器失败   java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.startup.Catalina.start(Catalina.java:689)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1575)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1565)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:子容器失败   在开始时   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)     在   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有6个

     

2014年11月2日上午12:09:30 org.apache.catalina.startup.Catalina开始   严重:所需的服务器组件无法启动,因此Tomcat是   无法开始。 org.apache.catalina.LifecycleException:失败   启动组件[StandardServer [8005]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在org.apache.catalina.startup.Catalina.start(Catalina.java:689)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardService [Catalina]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 7更多引起:org.apache.catalina.LifecycleException:失败   启动组件[StandardEngine [Catalina]]   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 9更多引起:org.apache.catalina.LifecycleException:一个孩子   容器在启动时失败   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有11个

1 个答案:

答案 0 :(得分:-1)

在我看来,您错过了Web应用程序中的一个或多个Spring Framework jar。如果查看堆栈跟踪,就会有一行:

Caused by: java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException

我会说你的网络应用程序中没有“spring-core”jar。您需要在Web应用程序的WEB-INF / lib目录中使用Spring jar。大多数基于Spring的Web应用程序至少需要“spring-beans”,“spring-context”,“spring-core”“spring-io”和“spring-web”......或许更多,我在这里工作。