I have the same problem as here and here but couldn\'t find a solution yet.
So my sample test project will show the whole relevant configuration and code:
Co
This is what worked for me. I had to used the @Inject tag.
public class FooValidator implements ConstraintValidator {
private ValidationService validationService;
@Inject
public FooValidator(ValidationService validationService){
this.validationService = validationService;
}
@Override
public void initialize(final FooValid constraintAnnotation) {
// TODO Auto-generated method stub
}
@Override
public boolean isValid(final Integer value, final ConstraintValidatorContext context) {
// this.validationService is always NULL!
Assert.notNull(this.validationService, "the validationService must not be null");
return false;
}
}