这个异常是出现在注入配置文件中配置好的属性时报错的: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'my.name' in value "${my.name}" 此时配置文件默认的名称为:application.properties 解决方法: 将配置文件名改为:application.yml 就可以正常启动. 后来又发现如果想让配置文件名称为application.properties 则需要在配置文件中以: xxx.yyy.name的格式来书写需要使用到的属性 |
Archiver|知识站 ( 鲁ICP备20004068号-1 )
GMT+8, 2020-6-23 22:50 , Processed in 0.014088 second(s), 17 queries .