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启动报错_第1张图片

选择debug run 或run启动项目

你可能感兴趣的:(intellij-idea,apache,java)