java.lang.NoSuchMethodError: javax.validation.BootstrapConfiguration.getClockProviderClassName
2022-09-01 23:02:19
JDK: 1.8.0_131
雄猫: 8.0.27.0
休眠验证器: 6.0.7.最终 + 所有依赖项下载自: 休眠验证器 6
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public AccountSyncResponse excute(AccountSyncRequest account_sync_request_)
{
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
Set<ConstraintViolation<AccountSyncRequest>> violations = validator.validate(account_sync_request_);
.
.
.
.
AccountSyncResponse _AccountSyncResponse = new AccountSyncResponse();
return _AccountSyncResponse;
}
代码在 上失败,并出现异常:Validation.buildDefaultValidatorFactory()
java.lang.NoSuchMethodError: javax.validation.BootstrapConfiguration.getClockProviderClassName()Ljava/lang/String;
at org.hibernate.validator.internal.xml.ValidationBootstrapParameters.<init>(ValidationBootstrapParameters.java:63)
at org.hibernate.validator.internal.engine.ConfigurationImpl.parseValidationXml(ConfigurationImpl.java:527)
at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:328)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:110)
看起来使用了错误的jar文件,但我无法弄清楚是哪一个。