我有一个带有相当多子模块的spring 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发布于 2019-07-18 10:04:15
嗯嗯。似乎这个项目被错误地导入了eclipse。也许是mvn eclipse:eclipse的错。
.project、.classpath等).gitignoreimport maven project导入项目现在起作用了。
https://stackoverflow.com/questions/57091306
复制相似问题