先贴一下bug详情

严重: 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:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/servlet/ServletContext"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1191)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:165)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
十二月 13, 2020 9:07:53 下午 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:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
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:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:341)
at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1238)
at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:592)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
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:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more

重点解决上面的这句话

Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/servlet/ServletContext"

bug原因

在当前模块引入了HttpServletResponse之后,我按了alt+enter自动添加了依赖。

自动在pom文件中生成的依赖如下图:

完成编码之后,运行tomcat7插件报错

解决办法

把当前依赖中的 compile 修改为 provided

根据间接依赖路径最短,maven会优先先加载这个引用的依赖,maven发现scope是provided的,所以运行的时候不会再加载这个jar包,就不会有冲突了

再次运行

信息: Initializing Spring FrameworkServlet 'springmvc'
21:34:23,634 INFO DispatcherServlet:494 - FrameworkServlet 'springmvc': initialization started
21:34:23,835 INFO XmlWebApplicationContext:590 - Refreshing WebApplicationContext for namespace 'springmvc-servlet': startup date [Sun Dec 13 21:34:23 CST 2020]; root of context hierarchy ...... 21:34:35,564 INFO DispatcherServlet:509 - FrameworkServlet 'springmvc': initialization completed in 11904 ms
十二月 13, 2020 9:34:35 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-80"]

bug已解决

A child container failed during start的更多相关文章

  1. Eclipse中启动tomcat报错:A child container failed during start

    我真的很崩溃,先是workspace崩了,费了好久重建的workspace,然后建立了一个小demo项目,tomcat中启动却报错,挑选其中比较重要的2条信息如下: A child container ...

  2. Java tomcat启动失败(Servlet3.0 Web Project):A child container failed during start

    Tomcat启动失败,失败全部信息: 五月 , :: 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetProper ...

  3. Eclipse启动tomcat 报“ A child container failed during start”

    org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]   at org.ap ...

  4. Tomcat error: A child container failed during start

    Tomcat error: A child container failed during start java.lang.NoClassDefFoundError: org/quartz/Sched ...

  5. A child container failed during start 解决方案

    症状:A child container failed during start 适用问题描述:tomcat挂空可以正常运行,载入项目时挂掉. 相关操作:之前为了省事,由于两个servlet功能类似所 ...

  6. Caused by: org.apache.catalina.LifecycleException: A child container failed during start

    错误提示: 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache. ...

  7. 严重: A child container failed during start

    四月 20, 2019 4:54:28 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler [&qu ...

  8. Eclipse Maven项目报错2之A child container failed during start

    问题:在同事那里拿了一个Eclipse的maven项目,导入报错,主要显示的是A child container failed during start 具体错误如下 六月 02, 2018 12:0 ...

  9. 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component

    自己写了个最简单的springMVC项目练练手,没有用maven,在WebContent中新建了lib文件夹,将jar包复制到这里面,然后add to build path到项目里. 启动Tomcat ...

  10. 启动Tomcat报错 “A child container failed during start”

    严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalin ...

随机推荐

  1. Arduion学习(一)点亮三色发光二极管

    这是我接触Arduion以来第一个小实验 实验准备: 1.查阅相关资料,了解本次实验所用到的引脚.接口的相关知识. 2.准备Arduion板(本次实验所用到的型号为mega2560).三色发光二极管. ...

  2. redis cluster可用性测试

    上一节,我们用三台redis组成了cluster,现在我们停掉一台试试: 比较奇怪的是,在停掉其中一台服务器之前建立的链接仍然可以正常执行命令,当我们断开重连时,命令就都被拒绝了: 关联知识: 什么时 ...

  3. 区块链V1版本实现之一

    1. 程序地址:https://gitee.com/Jame_sz/beijing_go_term2.git 2. 程序编写流程: //1. 定义结构(区块头的字段比正常的少) //>1. 前区 ...

  4. Django的下载及命令

    安装 命令行 pip3 install django==1.11.11 测试是否安装成功 django-admin 创建django项目 django-admin startproject 项目名称( ...

  5. JQuery 和 Bootstrap

    https://jquery.com/ 1. JQuery  的基础语法 $(select).action() 2. 查找标签 基本选择器 class选择器: $(".className&q ...

  6. Java 生成有序 UUID

    UUID.randomUUID() 生成的 UUID 是无序的,如果作为数据主键,不利于索引 Hibernate 的 UUIDHexGenerator.generate() 方法可以生成有序的 UUI ...

  7. HTTP请求头和响应头详解【转】

    最近老猿在开始学习爬虫相关的知识,由于老猿以前只做非web的后台应用,发现相关知识太过匮乏,导致学习很困难,为此不得不从一些基础知识恶补开始,对于这些知识,老猿会将网上找到的比较认可的内容直接转发. ...

  8. PyQt(Python+Qt)学习随笔:QScrollArea滚动区域的alignment属性

    老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 滚动区域的alignment属性对应QScrollArea的alignment属性,用于控制滚动区域 ...

  9. PLSQL Developer 工具应用

    用户scott使用: 解锁scott: 第一步:登陆管理员 SQL语句:Sqlplus sys/tiger as sysdba 第二步:解锁scott SQL语句:Alter user scott a ...

  10. 基于.NET的程序读取Excel文件的解决方案

    目录 0. 前言 1. 使用NPOI库读取Excel文件 2. 使用OleDbConnection 3. 相关参考 shanzm-2020年12月8日 23:48:11 0. 前言 以前基于 .NET ...