I have enabled method level validation in service class. However I got java.lang.NoClassDefFoundError
during startup of the application. Anyone know the workaround solution for this issue:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/method/MethodConstraintViolationException
at org.springframework.validation.beanvalidation.MethodValidationPostProcessor.afterPropertiesSet(MethodValidationPostProcessor.java:102)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 55 more
Hibernate 5 custom integration will be supported only with the upcoming Spring 4 (https://jira.springsource.org/browse/SPR-10466).
If you really want to use Hibernate 5, you will need to use it as standard JSR 303 bean validation provider with the standard message interpolation mechanism (i.e. no integration with MessageSource
, but standard ValidationMessages.properties
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With