码迷,mamicode.com
首页 > Web开发 > 详细

maven运行出现错误:Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]](xjl456852原创)

时间:2017-10-29 20:23:59      阅读:1574      评论:0      收藏:0      [点我收藏+]

标签:exec   loading   import   line   sans   ons   version   load   worker   

maven在使用tomcat插件tomcat7-maven-plugin:2.2:run运行项目,出现下面错误:

严重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
...
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)
    ... 6 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"
...
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(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start

解决方案:
将下面的依赖包从项目中删掉,因为这个servlet-api版本太低了.删掉这个依赖包,直接启动项目,如果可以启动,那就没什么问题.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

如果删除servlet-api提示缺少servlet-api包里的类,那就在maven仓库中找到最新版本的包,添加到pom.xml中.
或者
在idea中, File -> Project Structure ->Module -> 找到项目 ->Dependencies -> 点击右侧 "+"  -> Library..-> 拉到最底下 ->Application Server Libraries -> 添加一个tomcat的依赖.






maven运行出现错误:Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]](xjl456852原创)

标签:exec   loading   import   line   sans   ons   version   load   worker   

原文地址:http://www.cnblogs.com/xjl456852/p/7750815.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!