org.apache.catalina.core.ContainerBase:子容器在启动期间失败

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了org.apache.catalina.core.ContainerBase:子容器在启动期间失败相关的知识,希望对你有一定的参考价值。

我的问题看起来像其他人,但我已经尝试了其他解决方案,没有任何作用,所以我放在这里,我使用弹簧启动,需要集成谷歌驱动器下载文件,以下三个依赖关系需要根据谷歌文档添加。

    compile 'com.google.api-client:google-api-client:1.23.0'
    //compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
    compile 'com.google.apis:google-api-services-drive:v3-rev94-1.23.0'

我的应用程序和谷歌样本都独立工作,但是当我在我的项目build.gradle中包含上述依赖项时,注释掉的依赖项会导致以下异常,并且applcation无法启动。

2017-12-25 01:09:26.593[0;39m [32m INFO[0;39m [35m12741[0;39m [2m---[0;39m [2m[  restartedMain][0;39m [36ms.b.c.e.t.TomcatEmbeddedServletContainer[0;39m [2m:[0;39m Tomcat initialized with port(s): 8088 (http)
[2m2017-12-25 01:09:26.639[0;39m [32m INFO[0;39m [35m12741[0;39m [2m---[0;39m [2m[  restartedMain][0;39m [36mo.apache.catalina.core.StandardService  [0;39m [2m:[0;39m Starting service [Tomcat]
[2m2017-12-25 01:09:26.641[0;39m [32m INFO[0;39m [35m12741[0;39m [2m---[0;39m [2m[  restartedMain][0;39m [36morg.apache.catalina.core.StandardEngine [0;39m [2m:[0;39m Starting Servlet Engine: Apache Tomcat/8.5.16
[2m2017-12-25 01:09:26.871[0;39m [31mERROR[0;39m [35m12741[0;39m [2m---[0;39m [2m[cat-startStop-1][0;39m [36morg.apache.catalina.core.ContainerBase  [0;39m [2m:[0;39m A child container failed during start

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_151]
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_151]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939) ~[tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.16.jar:8.5.16]
    ... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5117) ~[tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.16.jar:8.5.16]
    ... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:182) ~[tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.16.jar:8.5.16]
    ... 8 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String;
    at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1141) ~[tomcat-embed-core-8.5.16.jar:8.5.16]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.16.jar:8.5.16]
    ... 10 common frames omitted

我使用的是使用tomcat容器的STS,所以tomcat和jetty有什么东西搞乱吗???

答案

我从SO那里得到帮助的尝试很少

  • 为jetty添加传递依赖关系false(导致麻烦的那个)但没有任何反应
  • 尝试使用servlet api 3.0.1,但没有运气

有效的解决方案是将servlet api 3.1.0添加到我的build.gradle

以上是关于org.apache.catalina.core.ContainerBase:子容器在启动期间失败的主要内容,如果未能解决你的问题,请参考以下文章

org.apache.catalina.core.StandardContext startInternal SEVERE:错误 listenerStart

tomcat(11)org.apache.catalina.core.StandardWrapper源码剖析

idea tomcat 启动报错 org.apache.catalina.core.StandardService.initInternal Failed to initialize connecto

gradle问题“main”groovy.lang.MissingPropertyException:没有这样的属性:类的baseDir:org.apache.catalina.core.Standa

tomcat(12)org.apache.catalina.core.StandardContext源码剖析

org.apache.catalina.core.StandardWrapperValve invoke的解决办法