我有一个带有多个子模块的spring-boot 2项目。
某些模块使用包含jackson-databind
的库。我为他们添加了排除对象。在进行mvn dependency:tree | grep jackson-databind
时,我没有2.2.2
依赖性。使用mvn spring-boot:run
可以完美工作。但是,在Eclipse中启动应用程序会导致以下错误。
我应该在哪里搜索错误源?
***************************
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:777)
The following method did not exist:
com.fasterxml.jackson.databind.Module.getTypeId()Ljava/lang/Object;
The method's class, com.fasterxml.jackson.databind.Module, is available from the following locations:
jar:file:/C:/Users/somebody/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.2.2/jackson-databind-2.2.2.jar!/com/fasterxml/jackson/databind/Module.class
jar:file:/C:/Users/somebody/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.6/jackson-databind-2.6.6.jar!/com/fasterxml/jackson/databind/Module.class
jar:file:/C:/Users/somebody/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8.jar!/com/fasterxml/jackson/databind/Module.class
jar:file:/C:/Users/somebody/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.8/jackson-databind-2.8.8.jar!/com/fasterxml/jackson/databind/Module.class
It was loaded from the following location:
file:/C:/Users/somebody/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.2.2/jackson-databind-2.2.2.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.databind.Module
答案 0 :(得分:0)
mvn eclipse:eclipse
的罪魁祸首。
.project
,.classpath
等).gitignore
import maven project
现在可以了。