SpringBoot启动 Unable to start embedded Tomcat

举报
隔壁老汪 发表于 2022/06/23 23:14:08 2022/06/23
【摘要】 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2018-10-11 08:51:09.752 ERROR 29856 --- [ main...

  
  1. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2. 2018-10-11 08:51:09.752 ERROR 29856 --- [ main] o.s.boot.SpringApplication : Application run failed
  3. org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  4. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155)
  5. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
  6. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
  7. at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
  8. at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
  9. at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
  10. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
  11. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
  12. at org.zerhusen.JwtDemoApplication.main(JwtDemoApplication.java:12)
  13. Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  14. at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126)
  15. at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86)
  16. at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413)
  17. at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174)
  18. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179)
  19. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152)
  20. ... 8 common frames omitted
  21. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
  22. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
  23. at org.apache.catalina.startup.Tomcat.start(Tomcat.java:367)
  24. at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:107)
  25. ... 13 common frames omitted
  26. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
  27. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
  28. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
  29. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  30. ... 15 common frames omitted
  31. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
  32. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
  33. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
  34. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  35. ... 17 common frames omitted
  36. Caused by: org.apache.catalina.LifecycleException: A child container failed during start
  37. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:949)
  38. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
  39. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  40. ... 19 common frames omitted

 

cmd 手动启动没有问题,在eclipse中运行报如上异常

换成jetty


  
  1. <!--排除starter-web 中内置tomcat依赖-->
  2. <dependency>
  3. <groupId>org.springframework.boot</groupId>
  4. <artifactId>spring-boot-starter-web</artifactId>
  5. <exclusions>
  6. <exclusion>
  7. <groupId>org.springframework.boot</groupId>
  8. <artifactId>spring-boot-starter-tomcat</artifactId>
  9. </exclusion>
  10. </exclusions>
  11. </dependency>
  12. <!--指定容器starter-jetty-->
  13. <dependency>
  14. <groupId>org.springframework.boot</groupId>
  15. <artifactId>spring-boot-starter-jetty</artifactId>
  16. </dependency>

 

一片祥和

文章来源: blog.csdn.net,作者:隔壁老瓦,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/wxb880114/article/details/83006415

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。