Throw a ConstraintViolationException for empty resources

Fixes #431
Merge pull request #433 from joschi/issue-431-IllegalArgumentException

Throw a ConstraintViolationException for empty resources