<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
执行报下面的错误
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sharding.demo.DTO.BatchParam.validParams(BatchParam.java:27)
at com.sharding.demo.DTO.BatchParam.main(BatchParam.java:37)
Caused by: javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:291)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:103)
at cn.hutool.extra.validation.ValidationUtil.<clinit>(ValidationUtil.java:27)
... 2 more
进程已结束,退出代码为 1
加入了下面两个包,执行正常
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.13.Final</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>