启动Tomcat报错:A child container failed during start

2024-09-01 20:08

本文主要是介绍启动Tomcat报错:A child container failed during start,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

在之前的工作和学习当中,有碰到过很多未知的,在当时看来十分令人疑惑的问题。当时的解决手段简单粗暴,就是直接百度,搜到对应的解决方案,直接抄过来试试,不行再换,直到问题消失,程序可以正常跑了,立马就不管不问了,认为解决了问题。其实这样很不好,一方面是问题消失了,但并不是真正的被解决了。另一方面则是,自己对这个问题没有更深的感悟和记录,以后碰到同样或者类似的问题,还是没有掌握解决的方法。只依靠百度搜索,对一个想要提升自己,成为编程高手的人来说,实在是最大的阻碍。基于此,以后会把自己碰到过的奇葩问题和解决方式记录在这里,提升自己,也希望能对大家解决问题能有所帮助。


在启动Tomcat的时候,发现启动不了,报如下的错误:

严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]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:942)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)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:744)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)... 6 more
Caused by: java.lang.NoClassDefFoundError: javax/annotation/security/DeclareRolesat org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:258)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:136)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69)at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 6 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.security.DeclareRolesat java.net.URLClassLoader$1.run(URLClassLoader.java:372)at java.net.URLClassLoader$1.run(URLClassLoader.java:361)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:360)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)... 15 more二月 23, 2019 4:55:15 下午 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[Tomcat].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:942)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.startup.Tomcat.start(Tomcat.java:366)at com.example.demo.DemoApplication.start(DemoApplication.java:36)at com.example.demo.DemoApplication.main(DemoApplication.java:18)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)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:744)
Caused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:950)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 6 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]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:942)... 8 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)... 6 more
Caused by: java.lang.NoClassDefFoundError: javax/annotation/security/DeclareRolesat org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:258)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:136)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69)at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 6 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.security.DeclareRolesat java.net.URLClassLoader$1.run(URLClassLoader.java:372)at java.net.URLClassLoader$1.run(URLClassLoader.java:361)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:360)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)... 15 moreException in thread "main" org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)at org.apache.catalina.startup.Tomcat.start(Tomcat.java:366)at com.example.demo.DemoApplication.start(DemoApplication.java:36)at com.example.demo.DemoApplication.main(DemoApplication.java:18)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 3 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 5 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:950)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 7 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].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:942)... 9 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)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:744)
Caused by: org.apache.catalina.LifecycleException: A child container failed during startat org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:950)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 6 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]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:942)... 8 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)... 6 more
Caused by: java.lang.NoClassDefFoundError: javax/annotation/security/DeclareRolesat org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:258)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:136)at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69)at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:328)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 6 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.security.DeclareRolesat java.net.URLClassLoader$1.run(URLClassLoader.java:372)at java.net.URLClassLoader$1.run(URLClassLoader.java:361)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:360)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)... 15 more

打印信息如上所示, 解决方案如下:
在pom.xml文件里面,引入:

<dependency><groupId>javax.annotation</groupId><artifactId>javax.annotation-api</artifactId><version>1.2</version>
</dependency>

这篇关于启动Tomcat报错:A child container failed during start的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1127918

相关文章

linux报错INFO:task xxxxxx:634 blocked for more than 120 seconds.三种解决方式

《linux报错INFO:taskxxxxxx:634blockedformorethan120seconds.三种解决方式》文章描述了一个Linux最小系统运行时出现的“hung_ta... 目录1.问题描述2.解决办法2.1 缩小文件系统缓存大小2.2 修改系统IO调度策略2.3 取消120秒时间限制3

解决systemctl reload nginx重启Nginx服务报错:Job for nginx.service invalid问题

《解决systemctlreloadnginx重启Nginx服务报错:Jobfornginx.serviceinvalid问题》文章描述了通过`systemctlstatusnginx.se... 目录systemctl reload nginx重启Nginx服务报错:Job for nginx.javas

SpringBoot项目启动后自动加载系统配置的多种实现方式

《SpringBoot项目启动后自动加载系统配置的多种实现方式》:本文主要介绍SpringBoot项目启动后自动加载系统配置的多种实现方式,并通过代码示例讲解的非常详细,对大家的学习或工作有一定的... 目录1. 使用 CommandLineRunner实现方式:2. 使用 ApplicationRunne

VMWare报错“指定的文件不是虚拟磁盘“或“The file specified is not a virtual disk”问题

《VMWare报错“指定的文件不是虚拟磁盘“或“Thefilespecifiedisnotavirtualdisk”问题》文章描述了如何修复VMware虚拟机中出现的“指定的文件不是虚拟... 目录VMWare报错“指定的文件不是虚拟磁盘“或“The file specified is not a virt

最新版IDEA配置 Tomcat的详细过程

《最新版IDEA配置Tomcat的详细过程》本文介绍如何在IDEA中配置Tomcat服务器,并创建Web项目,首先检查Tomcat是否安装完成,然后在IDEA中创建Web项目并添加Web结构,接着,... 目录配置tomcat第一步,先给项目添加Web结构查看端口号配置tomcat    先检查自己的to

Apache Tomcat服务器版本号隐藏的几种方法

《ApacheTomcat服务器版本号隐藏的几种方法》本文主要介绍了ApacheTomcat服务器版本号隐藏的几种方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需... 目录1. 隐藏HTTP响应头中的Server信息编辑 server.XML 文件2. 修China编程改错误

bat脚本启动git bash窗口,并执行命令方式

《bat脚本启动gitbash窗口,并执行命令方式》本文介绍了如何在Windows服务器上使用cmd启动jar包时出现乱码的问题,并提供了解决方法——使用GitBash窗口启动并设置编码,通过编写s... 目录一、简介二、使用说明2.1 start.BAT脚本2.2 参数说明2.3 效果总结一、简介某些情

使用Vue.js报错:ReferenceError: “Vue is not defined“ 的原因与解决方案

《使用Vue.js报错:ReferenceError:“Vueisnotdefined“的原因与解决方案》在前端开发中,ReferenceError:Vueisnotdefined是一个常见... 目录一、错误描述二、错误成因分析三、解决方案1. 检查 vue.js 的引入方式2. 验证 npm 安装3.

PHP执行php.exe -v命令报错的解决方案

《PHP执行php.exe-v命令报错的解决方案》:本文主要介绍PHP执行php.exe-v命令报错的解决方案,文中通过图文讲解的非常详细,对大家的学习或工作有一定的帮助,需要的朋友可以参考下... 目录执行phpandroid.exe -v命令报错解决方案执行php.exe -v命令报错-PHP War

若依部署Nginx和Tomcat全过程

《若依部署Nginx和Tomcat全过程》文章总结了两种部署方法:Nginx部署和Tomcat部署,Nginx部署包括打包、将dist文件拉到指定目录、配置nginx.conf等步骤,Tomcat部署... 目录Nginx部署后端部署Tomcat部署出现问题:点击刷新404总结Nginx部署第一步:打包