How to solve cast issue java.lang.ClassCastException: $Proxy cannot be cast to NotEmpty which is annotation
I want to thank you each for spending time on this issue.
The error comes from others implemented annotations that have this constraint validator.
@Constraint(validatedBy = {INotEmptyValidator.class})
.
This was done for sure by mistake.
Finally This is the good exemple of doing bean validation specifying constratint validator @Constraint(validatedBy = {INotEmptyValidator.class})
as interface.
The implementation NotEmptyValidatorImpl
is a spring bean.