启动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

相关文章

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间

springboot3打包成war包,用tomcat8启动

1、在pom中,将打包类型改为war <packaging>war</packaging> 2、pom中排除SpringBoot内置的Tomcat容器并添加Tomcat依赖,用于编译和测试,         *依赖时一定设置 scope 为 provided (相当于 tomcat 依赖只在本地运行和测试的时候有效,         打包的时候会排除这个依赖)<scope>provided

内核启动时减少log的方式

内核引导选项 内核引导选项大体上可以分为两类:一类与设备无关、另一类与设备有关。与设备有关的引导选项多如牛毛,需要你自己阅读内核中的相应驱动程序源码以获取其能够接受的引导选项。比如,如果你想知道可以向 AHA1542 SCSI 驱动程序传递哪些引导选项,那么就查看 drivers/scsi/aha1542.c 文件,一般在前面 100 行注释里就可以找到所接受的引导选项说明。大多数选项是通过"_

用命令行的方式启动.netcore webapi

用命令行的方式启动.netcore web项目 进入指定的项目文件夹,比如我发布后的代码放在下面文件夹中 在此地址栏中输入“cmd”,打开命令提示符,进入到发布代码目录 命令行启动.netcore项目的命令为:  dotnet 项目启动文件.dll --urls="http://*:对外端口" --ip="本机ip" --port=项目内部端口 例: dotnet Imagine.M

Linux服务器Java启动脚本

Linux服务器Java启动脚本 1、初版2、优化版本3、常用脚本仓库 本文章介绍了如何在Linux服务器上执行Java并启动jar包, 通常我们会使用nohup直接启动,但是还是需要手动停止然后再次启动, 那如何更优雅的在服务器上启动jar包呢,让我们一起探讨一下吧。 1、初版 第一个版本是常用的做法,直接使用nohup后台启动jar包, 并将日志输出到当前文件夹n

衡石分析平台使用手册-单机安装及启动

单机安装及启动​ 本文讲述如何在单机环境下进行 HENGSHI SENSE 安装的操作过程。 在安装前请确认网络环境,如果是隔离环境,无法连接互联网时,请先按照 离线环境安装依赖的指导进行依赖包的安装,然后按照本文的指导继续操作。如果网络环境可以连接互联网,请直接按照本文的指导进行安装。 准备工作​ 请参考安装环境文档准备安装环境。 配置用户与安装目录。 在操作前请检查您是否有 sud

SpringBoot项目是如何启动

启动步骤 概念 运行main方法,初始化SpringApplication 从spring.factories读取listener ApplicationContentInitializer运行run方法读取环境变量,配置信息创建SpringApplication上下文预初始化上下文,将启动类作为配置类进行读取调用 refresh 加载 IOC容器,加载所有的自动配置类,创建容器在这个过程

嵌入式Openharmony系统构建与启动详解

大家好,今天主要给大家分享一下,如何构建Openharmony子系统以及系统的启动过程分解。 第一:OpenHarmony系统构建      首先熟悉一下,构建系统是一种自动化处理工具的集合,通过将源代码文件进行一系列处理,最终生成和用户可以使用的目标文件。这里的目标文件包括静态链接库文件、动态链接库文件、可执行文件、脚本文件、配置文件等。      我们在编写hellowor

GNSS CTS GNSS Start and Location Flow of Android15

目录 1. 本文概述2.CTS 测试3.Gnss Flow3.1 Gnss Start Flow3.2 Gnss Location Output Flow 1. 本文概述 本来是为了做Android 14 Gnss CTS 的相关环境的搭建和测试,然后在测试中遇到了一些问题,去寻找CTS源码(/cts/tests/tests/location/src/android/locat

三相直流无刷电机(BLDC)控制算法实现:BLDC有感启动算法思路分析

一枚从事路径规划算法、运动控制算法、BLDC/FOC电机控制算法、工控、物联网工程师,爱吃土豆。如有需要技术交流或者需要方案帮助、需求:以下为联系方式—V 方案1:通过霍尔传感器IO中断触发换相 1.1 整体执行思路 霍尔传感器U、V、W三相通过IO+EXIT中断的方式进行霍尔传感器数据的读取。将IO口配置为上升沿+下降沿中断触发的方式。当霍尔传感器信号发生发生信号的变化就会触发中断在中断