I have jasypt password and the encrypted password defined in application.yml like this:
jasypt:
encryptor:
password: ${secretKey}
spring:
datasource:
password: ENC(${password})
And using @Value for it:
@Value("${spring.datasource.password}")
private String springPassword;
I have defined both secretKey and password in my environment variable. But when I start this spring boot application, it throws error:
Caused by: org.springframework.cache.Cache$ValueRetrievalException: Value for key 'spring.datasource.password' could not be loaded using 'com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource$$Lambda$209/172678484@5ae15'
If I hardcode both of the keys, than it's working fine.
Any help would be appreciated.