Properties (and all bean dependencies) are introduced after the bean is created (constructor execution).
You can use constructor injection if you need them.
@Component public class SomeBean { private String prop; @Autowired public SomeBean(@Value("${some.prop}") String prop) { this.prop = prop;
Another option is to move the constructor logic in the method annotated with @PostConstruct , which will be performed after the bean is created, and all its dependencies and property values ββwill be resolved.
source share