我正在尝试使用简单的 spring boot 应用程序。我在 ApplicationContext 上启动应用程序时遇到问题。
2017-04-26 11:17:31.101 WARN 14528 — [main] scaAnnotationConfigApplicationContext:上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为“standardJacksonObjectMapperBuilderCustomizer”的 bean 时定义的错误类路径资源 [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration.class]:通过方法 ‘standardJacksonObjectMapperBuilderCustomizer’ 参数 1 表达的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为“spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties”的 bean 时出错:bean 初始化失败;嵌套异常是 javax.validation.ValidationException:无法创建配置,因为找不到 Bean 验证提供程序。将像 Hibernate Validator (RI) 这样的提供程序添加到您的类路径中。 2017-04-26 11:17:31.116 信息 14528 — [主要] utoConfigurationReportLoggingInitializer:
启动 ApplicationContext 时出错。要显示自动配置报告,请在启用“调试”的情况下重新运行您的应用程序。 2017-04-26 11:17:31.121 错误 14528 — [主要] osbdLoggingFailureAnalysisReporter:
启动应用程序时出现上述错误。我正在使用 spring boot 1.5.1.RELEASE 版本。
请做有需要的。
编辑 2
package com.hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloWorld{
public static void main(String[] args) {
// TODO Auto-generated method stub
SpringApplication.run(HelloWorld.class, args);
}
}
原文由 Kumaresh Babu N S 发布,翻译遵循 CC BY-SA 4.0 许可协议
我通过排除 pom.xml 中的 hibernate-validator 依赖关系解决了这个问题。它工作正常,没有任何问题。