document.write("");

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

Maven 项目 启动报错如下:

WARN [main] AnnotationConfigServletWebServerApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
ERROR [main] SpringApplication: Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
...
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:203)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
... 6 common frames omitted

解决:
1.重新引入项目
2.IDEA 右侧菜单 Maven Projects -> Projects 中选中dev
3.IDEA 右侧菜单 Maven Projects -> 点击 Toggle Offline Mode


posted @ 2021-05-13 09:51  人间春风意  阅读(953)  评论(0编辑  收藏  举报