spring – ApplicationContextException:由于缺少ServletWebServerFactory bean,无法启动ServletWebServerApplicationContext
错误
Unable to start web server; nested exception is
org.springframework.context.ApplicationContextException:
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
解决
由于项目不是web的,可加配置文件中加入以下代码
# yml文件
spring:
main:
web-application-type: none
# properties文件
spring.main.web-application-type=none