①在springboot的spring-boot-starter-web默认引入了以下依赖:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.8.0</version></dependency><dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.8.7</version></dependency><dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.7</version></dependency> 在spring-boot-starter-web的这个依赖包里集成了所有的springframework的包比如spring-bean,tx,core等所就不需要引入springframework的包了。要不然由于版本号或者包冲突导致启动失败。解决方法:删掉springframe的包即可。②下面这个错误也是包问题
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: org/hibernate/validator/internal/engine/DefaultClockProvider
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) ... 18 common frames omittedCaused by: java.lang.NoClassDefFoundError: org/hibernate/validator/internal/engine/DefaultClockProvider 错误是因为引入了这个包造成的,这个包是干嘛的?软件包 javax.xml.validation 的描述 此包提供了用于 XML 文档验证的 API。Validation 是验证XML 文档是否为指定 XML schema 的实例的过程。XML模式定义了其实例文档将表示的内容模型(也称为 grammar 或 vocabulary),迁移springboot就是剔除所有的xml,所以xml都没了,检测xml造成错误了(自我理解哈)