In my spring boot project when I am trying to inject values using @Value
annotation its giving inconsistent behavior. In my controller it's working fine but when I use it in my @Component
class the field is null. I tried using @PropertySource
annotation on my component class but it still didn't work. I am using spring boot 3.1.0 and Java 17. Please advise.
Sharing repository link of the project. Contact Management Project
In this project I am trying to read the algorithm
property value from properties file in my src/main/java/com/shivam/cms/utils/EncryptionUtil.java
but it fails. Same works in ContactContoller.java
file