[错误日志]Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl


  最近在练习SpringBoot框架的时候,遇到这个很奇怪的问题。我是通过sts的Spring start project功能直接生成的工程,当选择SpringBoot2.2版本以下的时候,运行没有任何问题,一旦选择2.2以上的版本时,会报

  Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl 这个错误。

  经过检查发现SpringBoot已经自动依赖了该包:

 

  分析有可能是jar包版本不对引起的冲突,于是将该依赖从中剥离出来:

 

  Pom.xml中自动更改为:

                <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate.validator</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>    

  最后问题得以解决,成功正常运行。

  参考原博文:https://www.cnblogs.com/hiscode/p/Could_not_initialize_class_ConfigurationImpl.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM