【发布时间】:2018-11-14 09:14:44
【问题描述】:
我有 jasypt 密码和 application.yml 中定义的加密密码,如下所示:
jasypt:
encryptor:
password: ${secretKey}
spring:
datasource:
password: ENC(${password})
并为此使用@Value:
@Value("${spring.datasource.password}")
private String springPassword;
我已经在我的环境变量中定义了 secretKey 和密码。但是当我启动这个spring boot应用程序时,它会抛出错误:
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'
如果我对两个键都进行硬编码,那么它就可以正常工作了。
任何帮助将不胜感激。
【问题讨论】:
标签: java spring spring-boot jasypt