javax.validation.ValidationException:无法找到默认提供程序 [英] javax.validation.ValidationException: Unable to find default provider
问题描述
我目前正在使用Spring MVC Web应用程序并尝试使用@Valid注释挂钩验证。当我启动应用程序时,我遇到以下异常:
I am currently working on Spring MVC web app and trying to hook up validation using the @Valid annotation. When I fire up the application I'm getting the following exception:
javax.validation.ValidationException: Unable to find a default provider
我在类路径上有Hibernate Validator 3.1.0.GA以及javax验证1.0.0。 GA,Hibernate Core 3.3.1.GA和Hibernate Annotations 3.4.0.GA。
I have Hibernate Validator 3.1.0.GA on the classpath as well as javax validation 1.0.0.GA, Hibernate Core 3.3.1.GA and Hibernate Annotations 3.4.0.GA.
那些我没有看到的版本是不兼容的,还是任何人都不兼容想一想为什么我仍然在类路径上使用Hibernate Validator获得此异常的原因?
Is there an incompatiblity in those versions that I'm not seeing, or can anyone think of any reason why I'm still getting this exception with Hibernate Validator on the class path?
干杯,
上限
推荐答案
Hibernate Validator 3.1不是JSR303提供程序。您需要升级到Hibernate Validator 4或更高版本。
Hibernate Validator 3.1 is not a JSR303 provider. You need to upgrade to Hibernate Validator 4 or later.
这篇关于javax.validation.ValidationException:无法找到默认提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!