dea啓動spring boot項目報錯:spring
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.
依賴包:tomcat
org.springframework.boot spring-boot-starter-tomcat ${springboot-version} provided
打包是不須要tomcat的,因此這裏把tomcat的依賴改成provided,可是idea存在一個bug,就是provided的pom不會加入classpath中,因此運行的時候就找不到tomcat相關的包,
解決:springboot
選擇debug run 或run啓動項目ide