ulisesbocchio / jasypt-spring-boot

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

Decryption issues #350

Open ones1kk opened 1 year ago

ones1kk commented 1 year ago

Hello, I am currently working on a toy project by applying your library. First of all thank you for your hard work.

But while using your library, I ran into an issue.

That is, it cannot properly register JasyptConfig in other submodules as beans in the test environment.

@Import, bean configuration in TestConfiguration... none of that works.

Please leave some answers regarding this issue.

If there's anything I've missed, please tell me.

Thank you.

(Plus JasyptConfig.class is defined in another sub module and @SpringBootTest class is defined in other module too)

Here are some cases.

Case 1 If i do not configure anything in my IntergrationTestConfig(for @SpringBootTest) image

Case 2 *If JasyprtConfig.class imported by @Import image

Meesages

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jasyptStringEncryptor' defined in com.breakingbad.workerhub.core.config.JasyptConfig: Unsatisfied dependency expressed through method 'jasyptStringEncryptor' parameter 0; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'jasyptStringEncryptor': Requested bean is currently in creation: Is there an unresolvable circular reference?

Case 3 If i declared StringEncryptor with @Bean image

Messages

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'jasyptStringEncryptor': Requested bean is currently in creation: Is there an unresolvable circular reference?

And plus it's funny fact that it's working well in running SpringApplication.