English 中文(简体)
BeanValidation Error - JSR 303 Bean accreditation implementation not found in categorypath
原标题:BeanValidation Error - JSR 303 Bean validation implementation not found on classpath

I ́m致力于这一瓦阿丁图里系列。

https://www.youtube.com/watch?v=k-DxZ1reIdM&list=PLcRrh9hGNallPtT2VbUAsrWqvkQ-XE22h&index=11

文本版本:https://vaadin.com/learn/tutorials/modern-web-apps-with-children-post-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 Validation提供商? I ́m与Movaadin合作,作为教学项目。

最佳回答

Solved by adding the following dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
</dependency>
问题回答

Hibernate Validator

添加整个<条码>代谢-启动-效力>。

You can simply add the Hibernate Validator, which will add the minimum amount of libraries to your project.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>yourHibernateVersion</version>
</dependency>

这种办法由Vadin公司本身提出,因为你可参看here

Hibernate Validator serves as the only implementation of Jakarta Validation (formerly known as Bean Validation) specification versions 2.0, 3.0, and upcoming 3.1.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签