Spring 3.1 Autowiring does not work inside custom constraint validator
I have an issue with bean autowiring inside a custom constraint validator. A constraint validator instance is not given using Spring's LocalValidatorFactoryBean. The JSR-303 provider is hibernate-validator 4.2.0.Final. Spring configuration excerpt : <!-- JSR 303 validation --> <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" /> <bean class="org.springframework.validation.beanvalidation.MethodValidationPostProcessor"/> Custom Constraint Validator: import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext;