ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.87k stars 514 forks source link

Windows and Linux compatibility issues #375

Open herosql opened 10 months ago

herosql commented 10 months ago

I find Windows and Linux compatibility issue.

Repositorie:https://github.com/herosql/spring-jasypt-demo

I pull my own code and package it under Linux system

mvn package

Running the project

cd target
java -jar demo-0.0.1-SNAPSHOT.jar 

Using commands for testing

 curl http://localhost:8080/demo/get

Test passed

Send demo-0.0.1-SNAPSHOT.jar to Windows

Running

java -jar demo-0.0.1-SNAPSHOT.jar 

error info:

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoController': Injection of autowired dependencies failed; nested exception is com.ulisesbocchio.jasyptspringboot.exception.DecryptionException: Unable to decrypt property: ENC(pBkhjhBscoFceXlO18XUkz+GoGkbjTz0K9JconRTnWbo3UM5sjvAZo2gMAPYdU5+) resolved to: ENC(pBkhjhBscoFceXlO18XUkz+GoGkbjTz0K9JconRTnWbo3UM5sjvAZo2gMAPYdU5+). Decryption of Properties failed,  make sure encryption/decryption passwords match
herosql commented 10 months ago

machine environment

windows

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode, sharing)

Windows 10 Professional 64-bit

Linux

java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal
herosql commented 10 months ago

@ulisesbocchio

lzpqq commented 9 months ago

I also have the same problem. However, they are all Linux systems with different versions of JDK.

The problematic one is 1.8.0 152, there is no problem with 1.8.0 171