Using @Autowired component in custom JSR-303 validator
I'm trying to implement a custom validator for my model classes that autowires a custom bean of mine (declared via @Component ). In this, I followed the Spring documentation on that topic . My AuthenticationFacade object is implemented according to this tutorial . When running my tests, however, the autowired attribute in the Validator object is always null . Why is that? Here are the relevant parts of my code: My custom bean , AuthenticationFacadeImpl.java @Component public class AuthenticationFacadeImpl implements AuthenticationFacade { boolean hasAnyRole(Collection<String> roles) { //