0

我正在尝试为我的应用程序添加 JPA 支持,但是出现此错误:

Caused by: javax.validation.ValidationException: Unable to find a default provider
    at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
    at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:183)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    ... 37 more

虽然我在 WEB-INF/lib 文件夹中有这些罐子:

validation-api-1.0.0.GA.jar
validation-api-1.0.0.GA-sources.jar
4

1 回答 1

3

我不确定,但我最好的猜测是这validation-api实际上不是验证的实现,所以你仍然需要包含一个比如Hibernate Validator

于 2012-06-11T20:22:16.247 回答