"description":"No key was installed for encryption service","status":"NO_KEY"
- 错误描述
{
"description": "No key was installed for encryption service",
"status": "NO_KEY"
}
- 错误原因:
- jce安装有问题
- 没有配置对应的密钥或未读取到配置文件中的秘钥
- SpringCloud Config的.yml文件配置有问题
- 解决办法:
- 第一种问题:
安装JCE即可解决!
下载地址:
JDK 6 JCE
http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
JDK 7 JCE
http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
JDK 8 JCE
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
安装方法:
下载完后,可看到这两个jar包:local_policy.jar
和US_export_policy.jar
替换或新增%JDK_HOME%\jre\lib\security
目录下的这两个jar。 - 第二、三个问题:
在bootstrap.yml
文件中配置秘钥:
注: 如果是在encrypt: key: foobar
application.yml
中配置秘钥有可能读取不到,依然报该错误 - 第一种问题: