启动DeskApplication报错

Blade 未结 1 1920
杨彦彬
杨彦彬 2019-11-12 18:12

一、该问题的重现步骤是什么?

1. 启动DeskApplication报错

2. 

2019-11-12 18:09:25.297  INFO 90552 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Loading nacos data, dataId: 'blade.yaml', group: 'DEFAULT_GROUP'
2019-11-12 18:09:25.321  INFO 90552 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Loading nacos data, dataId: 'blade-dev.yaml', group: 'DEFAULT_GROUP'
2019-11-12 18:09:25.334  INFO 90552 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='NACOS', propertySources=[NacosPropertySource {name='blade-desk-dev.yaml'}, NacosPropertySource {name='blade-desk.yaml'}, NacosPropertySource {name='blade-dev.yaml'}, NacosPropertySource {name='blade.yaml'}]}
2019-11-12 18:09:25.341  INFO 90552 --- [           main] org.springblade.desk.DeskApplication     : The following profiles are active: dev
2019-11-12 18:09:26.271  WARN 90552 --- [           main] ConfigServletWebServerApplicationContext : 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.
2019-11-12 18:09:26.307 ERROR 90552 --- [           main] o.s.boot.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.
 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.10.RELEASE.jar:5.1.10.RELEASE]
 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49) [blade-core-launch-2.2.0.RELEASE.jar:na]
 at org.springblade.desk.DeskApplication.main(DeskApplication.java:34) [classes/:na]
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) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.1.9.RELEASE.jar:2.1.9.RELEASE]
 ... 8 common frames omitted

3.

麻烦帮忙解决下,谢谢。



1条回答
  •  admin
    admin (楼主)
    2019-11-13 10:58

    缺少了spring-web依赖,有可能没有引入成功。整个工程执行下mvn clean compile然后启动试试

    如果还不行,就把.m2下的依赖都删掉,然后重现下载,再执行mvn clean compile然后启动试试

    同样错误的帖子说明如下:https://www.cnblogs.com/sxdcgaq8080/p/9843607.html

    0 讨论(0)
提交回复