本地测试SpringBoot,启动报错如下:

21:04:19.284 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.yml'
	at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:545)
......
Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
......
Caused by: java.nio.charset.MalformedInputException: Input length = 1
	......

最后发现是application.yml文件的编码问题,从GBK改为UTF-8就好了。

相关文章:

  • 2021-10-01
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-07-26
猜你喜欢
  • 2022-01-11
  • 2021-09-14
  • 2022-12-23
  • 2021-12-11
  • 2021-07-09
  • 2021-08-20
相关资源
相似解决方案