Open 1451762067 opened 1 year ago
in the version 3.0.5, you can set the property jasypt.encryptor.bean with you customer bean name, in your case, it is jasyptStringEncryptor. after this, the spring will just load customer bean, to avoid create two beans, the other bean was DefaultLazyEncryptor
I encountered a problem while using Jasypt in my Spring Boot project. According to the official documentation, to replace the default encryptor, I just need to manually inject a bean named "jasyptStringEncryptor" to replace the default StringEncryptor object. However, after I did this, Spring kept throwing an error "required a single bean, but 2 were found", indicating that the type was duplicated. I have checked many materials but to no avail. I have tried switching between Spring Boot 2 and Spring Boot 3, as well as JDK 8, 11, and 17, but the problem persists. Please refer to my code and error message below.
Could you please help me with this issue? Thank you very much!
![image](https://user-images.githubusercontent.com/13687626/223393615-dc7d1a0a-7bd5-483f-af32-7d0e7dfdb8d2.png)