找不到 bootstrapConfiguration.getClockProviderClassName() 方法

启动报错日志如下:

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.hibernate.validator.internal.xml.config.ValidationBootstrapParameters.<init>(ValidationBootstrapParameters.java:63)

The following method did not exist:

    javax.validation.BootstrapConfiguration.getClockProviderClassName()Ljava/lang/String;

The method's class, javax.validation.BootstrapConfiguration, is available from the following locations:

    jar:file:/D:/Dev/repositories/javax/javaee-api/7.0/javaee-api-7.0.jar!/javax/validation/BootstrapConfiguration.class
    jar:file:/D:/Dev/repositories/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar!/javax/validation/BootstrapConfiguration.class

It was loaded from the following location:

    file:/D:/Dev/repositories/javax/javaee-api/7.0/javaee-api-7.0.jar

报错是在引入的hibernate-valitator-6.0.16.Final包里的引用的方法找不到。

org.hibernate.validator.internal.xml.config.ValidationBootstrapParameters#ValidationBootstrapParameters(javax.validation.BootstrapConfiguration, java.lang.ClassLoader)

找不到方法的代码如下:

bootstrapConfiguration.getClockProviderClassName()
bootstrapConfiguration.getValueExtractorClassNames()

出现问题的背景是将SSM项目重构为基于SpringBoot2.x的项目,解决方案为将 JavaEE7升级到JavaEE8

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>
</dependency>

升级至

 <dependency>
     <groupId>javax</groupId>
     <artifactId>javaee-api</artifactId>
     <version>8.0</version>
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值