I have requirement that in common api module(multi module project) I can't use any kind of hibernate's validation annotations, so I did use one from javax.validation which is acceptable.
Problem starts when I want to validate my domain objects(I use vaadin) that contains NotBlank annotation. I get the following exception
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.String'. Check configuration for 'name'
Validation is invoked by call
Validation.buildDefaultValidatorFactory().validateValue(beanType, propertyName, value)
Same code works perfectly with hibernate's NotBlank
Also @Size @NotNull from javax works fine.
Is it possible to provide NotBlank validator implementation to DefaultValidatorFactory?
Am I missing some dependency? (I have hibernate-validator already)
Does NotBlank from javax works the same as NotBlank from hibernate(I mean does it validate strings?)
How to solve this?