Skip to content
Advertisement

hibernate validator throws exception ValidationException: HV000028 for @Past annotation

I am validating an entity with a hibernate validator in a spring boot project. I got an exception for the Date validator @Past . I faced javax.validation.ValidationException: HV000028: Unexpected exception during isValid call

This is the dependency I have in my gradle.build file

implementation 'org.springframework.boot:spring-boot-starter-validation'

The following my a similar entity I have

JavaScript

This is a log trace

JavaScript

Advertisement

Answer

This is for anyone having the same issue as mine. My issue was the Date objects were from java.sql.Date. I changed them to java.util.Date now the validation works.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement