Spring
Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
owgno6
2019. 10. 10. 10:52
JSR 303 사용 시 다음과 같은 예외에 직면할 수 있다.
Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
버젼은 6이상도 있지만 5.2.4.Final이 제일 안정적이다.
다음 디펜던시 (Dependency)를 추가하거나
1
2
3
4
5
|
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
|
아래처럼 범용 디펜던시를 추가해준다.
1
2
3
4
5
|
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>5.2.4.Final</version>
</dependency>
|
그래도 해결되지 않는다면 기존에 hibernate관련 모든 디펜던시를 지우고 아래 디펜던시를 추가해준다.
1
2
3
4
5
|
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
|
다음과 같은 예외에 직면한다면,
Caused by: java.lang.ClassNotFoundException: javax.el.PropertyNotFoundException
다음을 추가한다.
1
2
3
4
5
6
7
8
9
10
11
|
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<version>2.2</version>
</dependency>
|