hibernate-validator 版本不兼容,Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl解决方案

  刚才把 SpringBoot 2.0 换成 1.59 版本,报上面的错误 Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl解决方案   可能原因是版本不兼容和依赖冲突 所以,这里先排除自带的包
  1. <dependency>
  2.     <groupId>org.springframework.boot</groupId>
  3.     <artifactId>spring-boot-starter-web</artifactId>
  4.     <!--<version>RELEASE</version>-->
  5.     <exclusions>
  6.         <exclusion>
  7.             <groupId>org.hibernate</groupId>
  8.             <artifactId>hibernate-validator</artifactId>
  9.         </exclusion>
  10.     </exclusions>
  11. </dependency>
  然后添加我们需要的包
  1. <dependency>
  2.     <groupId>javax.validation</groupId>
  3.     <artifactId>validation-api</artifactId>
  4.     <version>1.0.0.GA</version>
  5. </dependency>
  6. <dependency>
  7.     <groupId>org.hibernate</groupId>
  8.     <artifactId>hibernate-validator</artifactId>
  9.     <version>4.3.1.Final</version>
  10. </dependency>
  原文地址: https://www.cnblogs.com/hiscode/p/Could_not_initialize_class_ConfigurationImpl.html

发表评论

目前评论:1