Tomcat 8 Embedded - WebServlet - 'A child container failed during start'

半腔热情 提交于 2019-11-29 18:06:25

You need to combine two solutions:

First of all, validate the mvn dependency:tree, this can list all dependencies that you have associate with this specific jar servlet-api:jar.

If you find some dependency that is producing some conflict you can work in two ways:

  1. Remove o replace the dependency (Ex. jetty, camel).
  2. Mark the dependency like provided, that means that will be use for the jar in the point number 1.

Is so clear that the second options can be the best, but sometimes you need to clean ups your dependencies.

Note: Be sure that you are using the correct version and Id of the dependency that is listed in the mvn dependency:tree.

`<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
</dependency>`

The mvn dependency:tree should produce:

`+- javax.servlet:javax.servlet-api:jar:3.0.1:provided (scope not updated to 
compile)`

This only one kind of exception that can produce a jar conflict inside of the container, in this case servlet-api.jar.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!