I think the problem with creating ConstraintViolationException instances you describe is addressed with
http://opensource.atlassian.com/project ... e/BVAL-198As outlined in said issue you can help yourself by wrapping your set of constraint violations into a new HashSet:
Code:
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(domainObject);
//compiler error: ("The constructor ConstraintViolationException(Set<ConstraintViolation<Object>>) is undefined")
throw new ConstraintViolationException(constraintViolations);
//this works
throw new ConstraintViolationException(new HashSet<ConstraintViolation<?>>(constraintViolations));
Regards,
Gunnar