I´m working on this Vaadin Tutorial series.
https://www.youtube.com/watch?v=k-DxZ1reIdM&list=PLcRrh9hGNallPtT2VbUAsrWqvkQ-XE22h&index=11
Text Version: https://vaadin.com/learn/tutorials/modern-web-apps-with-spring-boot-and-vaadin/vaadin-form-data-binding-and-validation?
I´m trying to use Binding but I get the following error in my Terminal:
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.
more below the next:
Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
How do I add a Bean Validation provider? I´m working with vaadin as a maven project same as in the tutorial.
Solved by adding the following dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
Adding the whole spring-boot-starter-validation is a little bit overkill.
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>
This approach is suggested by the Vaadin company itself, as you can see 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With