There is the following configuration in YAML
paypal: mode:live
In the class, read through the @Value property
@Value("${paypal.mode}") private String mode;
When the program runs, it reports an error
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'paypal.mode' in string value "${paypal.mode}"
The root of the problem is that the configuration does not conform to the YAML file format requirements. One less space between mode and live
paypal: mode: live
After adding spaces, it works fine.