I'm trying to validate something using the GWT BeanValidation but these two lines are giving me some trouble:
Validator validator=Validation.buildDefaultValidatorFactory().getValidator();
Set<ConstraintViolation<Contact>> violations = validator.validate(contact, Default.class);
The thing is, I have imported the corresponding classes:
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.groups.Default;
But still, the Validator, Validation, ConstraingViolation and Default references in the code are underlined in red and the error they show is:
javax.validation.Validator can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.
I have checked that the necessary lib validation-api-1.0.0.GA.jar is in the classpath and everything seems normal.
Anyone happens to know what could be the problem?
thanks!!