springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

时间:2022-07-23 04:08:04

学习springboot,在启动时抛出下图异常

springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

往下看异常信息,找到异常的具体位置

springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

找到application.yml文件的对应位置,发现params配置前面多了空格

springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

去掉空格重新启动,可以了

springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

springboot启动报异常,Failed to load property source from location 'classpath:/application.yml'

写代码还是要仔细啊