52997 (2) [Avatar] Offline

After going through all 3.4 section, I can use "mvn spring-boot:run" to run licensing service without any problem:

But, when I run it with java command like:
java -jar target/licensing-service-0.0.1-SNAPSHOT.jar
I always get java.lang.IllegalStateException: Cannot decrypt: key=spring.datasource.password

According to this book, I have already set system environment variable ENCRYPT_KEY=IMSYMMETRIC

My OS is Windows7

Really need a help, Thanks!!
52997 (2) [Avatar] Offline
If I don't configure licensing service to use encryption, there is no problem to run it by using java command.
202622 (5) [Avatar] Offline
I ran into the same issue running on Windows 10.

I set the environment variable ENCRYPT_KEY=IMSYMMETRIC, but still was getting the error saying it couldn't decrypt the database password.

A workaround is to explicitly pass the JVM the encrypt.key property (on the service i.e. organization-service, licensing-service) when you start the application. The cmd argument is as follows:

From STS, you can right click the service -> run as -> Run Configuration -> "Arguments" tab -> and place aforementioned argument in the "VM arguments:" section. This way you can still run from inside your IDE.