I have Spring backend with few modules with few tens of controllers and services. When somewhere in this services occurs ConstraintViolationException in log file I see only common exception, and there is not specified which exactly constraints are violated:
javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callbackevent:'preUpdate'. Please refer to embedded ConstraintViolations for details.
In JPA Specification and Bean Validation API there is no appointments about printing out violations. If I don't mistake in Hibernate all violated constraints are printed out automatically.
- Is there any mechanism to say eclipselink to print violated constraints or maybe any mechanism to define system-wide custom printer of violations?
- If no, do I have to manually implement printing of violated exceptions in each controller and service? Or maybe some mechanism like
@org.springframework.web.bind.annotation.ExceptionHandler
is exist? (@ExceptionHandler
is not convenient for internal services)