beanvalidation错误-在类路径上找不到jsr 303 bean验证实现

o8x7eapl  于 2021-07-11  发布在  Java
关注(0)|答案(1)|浏览(388)

我´我在做这个瓦丁系列教程。
https://www.youtube.com/watch?v=k-dxz1reidm&list=plcrrh9hgnallptt2vbuasrwqvkq-xe22h&index=11
文本版本:https://vaadin.com/learn/tutorials/modern-web-apps-with-spring-boot-and-vaadin/vaadin-form-data-binding-and-validation?
我´我正在尝试使用绑定,但在终端中出现以下错误:

2020-11-22 09:11:11.012  INFO 38103 --- [nio-8080-exec-2] c.vaadin.flow.spring.SpringInstantiator  : The number of beans implementing 'I18NProvider' is 0. Cannot use Spring beans for I18N, falling back to the default behavior
2020-11-22 09:11:11.373  INFO 38103 --- [nio-8080-exec-2] com.vaadin.validator.BeanValidator       : A JSR-303 bean validation implementation not found on the classpath or could not be initialized. BeanValidator cannot be used.

下一页:

Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.

如何添加bean验证提供者?我´我和vaadin一起工作,作为maven项目,和教程中的一样。

zrfyljdw

zrfyljdw1#

通过添加以下依赖项解决

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

相关问题