Action: Correct the classpath of your application so that it contains a single, compatible version

前言

因为本maven仓库的servlet-api-2.5.jar的原因,导致启动报错。错误描述也是各种都有,我这边是:

 Failed to start component [NonLoginAuthenticator[StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_181]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_181]

A child container failed during start

等等。

解决办法

临时解决办法:删除本地仓库的servlet-api-2.5.jar jar包,启动就可以成功了。
终极解决办法:在项目中去除jar。eclipse或者idea,查看maven结构,找到这个jar包是在哪一个jar里面。然后再pom.xml里面把它去掉就好了
我的是idea,示例如下:
Action: Correct the classpath of your application so that it contains a single, compatible version_第1张图片
接下来,在项目里面的这个jar包这里,把它去掉就可以了
Action: Correct the classpath of your application so that it contains a single, compatible version_第2张图片
启动测试:
Action: Correct the classpath of your application so that it contains a single, compatible version_第3张图片

你可能感兴趣的:(后端问题)