首页 / 知识

springboot启动报错Could not resolve placeholder xxx

2023-04-11 16:18:00

springboot启动报错Could not resolve placeholder xxx
今天启动SpringBoot项目的时候报错
 
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 
 
'spring.datasource.druid.initialSize' in value "${spring.datasource.druid.initialSize}"
 
首先确认一下配置文件里该字段是否存在以及字段名是否写对了。如果确认无误,再看看配置文件是否引用了,一般我们不同的环境会配置不同的配置文件,所以在application.yml中要指定使用哪个配置文件
 
spring:
 
  profiles: 
 
    active: druid
 
启动过程中会输出使用了哪个文件,注意留意,如果都没有输出,那说明没生效
 
如果检查了上面都没问题,使用idea的兄弟可以试试Build -> Rebuild Project重新构建试试,我就成功了。

启动启动报错项目报错xxxSpringboot

最新内容

相关内容

热门文章

推荐文章

标签云

猜你喜欢