我在使用hibernate验证方面遇到了一些问题,我不知道是什么原因。在初始化时,控制台中存在错误。我想使用来自hibenrate-validation的@PESEL注释。我已经读过我必须使用新版本的hibernate验证但它会导致问题 - 我试图删除javax.validation或更改hibernate验证的版本,但没有效果。问题仍然是一样的。
这是我的pom.xml文件
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@8c3619e: startup date [Sun Nov 26 06:58:24 CET 2017]; root of context hierarchy
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@8c3619e: startup date [Sun Nov 26 06:58:24 CET 2017]; root of context hierarchy
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/DefaultValidatorConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/ClockProvider
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/DefaultValidatorConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/ClockProvider
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/ClockProvider
Caused by: java.lang.NoClassDefFoundError: javax/validation/ClockProvider
Caused by: java.lang.ClassNotFoundException: javax.validation.ClockProvider
错误:
$http.post("../crud/projects_update.php",{
step_number : $scope.step_number,
//step_one start
if(step_number == 1){ // This is where I get an error.
project_id : $scope.project_data.project_id,
project_title : $scope.project_data.project_title
}
})
.then(function(response){
// do something here
});
答案 0 :(得分:1)
我也面临着同样的问题。这是由于jar版本不兼容。我刚刚将spring(5.1.5),spring-boot(2.1.6)和Spring data(1.94.4)版本更新为最新的稳定版本,问题已解决