springboot的加密依赖
<!--数据库加密-->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
错误异常显示
//下面两种异常描述,提及了jce的的都可以用下面方法解决
Exception in thread "main" org.jasypt.exceptions.EncryptionOperationNotPossibleException:
=======================================================================================================================================================================================================================
Description:
Failed to bind properties under 'spring.datasource.password' to java.lang.String:
Reason: Encryption raised an exception. A possible cause is you are using strong encryption algorithms and you have not installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine
Action:
Update your application's configuration
解决方案
JDK8安装JCE无限强度
步骤1:
去官网下载jar包
https://www.oracle.com/java/technologies/javase-jce8-downloads.html
步骤2:
下载的两个jar包
替换掉
原来jdk下
(C:\My_Development\jdk1.8.0_91\jre\lib\security)的jar包:如下图
下载的两个jar包
jdk的地址
C:\My_Development\jdk1.8.0_91\jre\lib\security