gpt4 book ai didi

java - @Autowired-ing DAO 时出现 ValidationException

转载 作者:行者123 更新时间:2023-12-02 00:20:54 25 4
gpt4 key购买 nike

我正在尝试为我的应用程序添加 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 文件夹中有这些 jars:

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

最佳答案

我不确定,但我最好的猜测是 validation-api 实际上并不是验证的实现,因此您仍然需要包含一个,例如 Hibernate Validator .

关于java - @Autowired-ing DAO 时出现 ValidationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10985912/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com