启动springboot时报错 APPLICATION FAILED TO START 包冲突
具体日志如下
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.registerWellKnownModulesIfAvailable(Jackson2ObjectMapperBuilder.java:823)
The following method did not exist:
com.fasterxml.jackson.databind.Module.getTypeId()Ljava/lang/Object;
The calling method's class, org.springframework.http.converter.json.Jackson2ObjectMapperBuilder, was loaded from the following location:
jar:file:/Users/dream/.m2/repository/org/springframework/spring-web/5.3.13/spring-web-5.3.13.jar!/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.class
The called method's class, com.fasterxml.jackson.databind.Module, is available from the following locations:
jar:file:/Users/dream/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.3.3/jackson-databind-2.3.3.jar!/com/fasterxml/jackson/databind/Module.class
The called method's class hierarchy was loaded from the following locations:
com.fasterxml.jackson.databind.Module: file:/Users/dream/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.3.3/jackson-databind-2.3.3.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.http.converter.json.Jackson2ObjectMapperBuilder and com.fasterxml.jackson.databind.Module
Process finished with exit code 1
报错日志的意思
观察maven依赖
对比pom文件
采用parent方式引入springboot可以解决问题