Springboot startup error could not resolve placeholder XXX

An error was reported when launching the springboot project today

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 
'spring.datasource.druid.initialSize' in value "${spring.datasource.druid.initialSize}"

First, confirm whether the field exists in the configuration file and whether the field name is written correctly. If it is confirmed that there is no error, check whether the configuration file is referenced. Generally, we will configure different configuration files in different environments, so we need to specify which configuration file to use in application.yml

spring:
  profiles: 
    active: druid

During the startup process, which file is used will be output. Note that if there is no output, it means that it has no effect

if you check the above, you can try build – & gt; Rebuild project try to rebuild and I succeed.


Read More: