IDEA开发工具报错----spring boot启动报错

dea启动spring boot项目报错:

org.springframework.context.ApplicationContextException: Unable to
start embedded container; nested exception is
org.springframework.context.ApplicationContextException: Unable to
start EmbeddedWebApplicationContext due to missing
EmbeddedServletContainerFactory bean.
Caused by: org.springframework.context.ApplicationContextException:
Unable to start EmbeddedWebApplicationContext due to missing
EmbeddedServletContainerFactory bean.

依赖包:

org.springframework.boot
spring-boot-starter-tomcat
${springboot-version}
provided

打包是不需要tomcat的,所以这里把tomcat的依赖改为provided,但是idea存在一个bug,就是provided的pom不会加入classpath中,所以运行的时候就找不到tomcat相关的包,
解决:

《IDEA开发工具报错----spring boot启动报错》

选择debug run 或run启动项目

    原文作者:盘子
    原文地址: https://segmentfault.com/a/1190000015653943
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞