SpringBoot 服务启动报错Application run failed
可能是application.yml文件格式错误,编辑的时候是根据提示默认推荐gbk的格式
后来将格式转成UTF-8后就好了
(2)启动过程中的时候报:
2019-02-22 15:50:50.187 ERROR 11880 --- [ 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.
是因为需要在启动类的中添加@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}),排除此类的autoconfig。
springboot很多依赖插件是有依赖时,就会读取相关配置,如果读取不到,就会使用默认的,可能会报错,但是又在项目中不好排除就可以使用 @EnableAutoConfiguration 注解。启动的时候就不会去读取这些配置了。
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found char
尝试在Maven项目处右击选择Reload project