Throw a ConstraintViolationException for empty resources

Fixes #431