SpringBoot and jackson.databind compatibility error reporting problem
———- ——
1ãSpringBoot version V2.0.0
Its dependency on jackson-databind version is V2.9.4, when reading parameters from the configuration file application.properties to assign to the bean, it keeps reporting the following error.
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:400)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
at com.fasterxml.jackson.databind.deser.DeserializerCache.hasValueDeserializerFor(DeserializerCache.java:191)
at com.fasterxml.jackson.databind.DeserializationContext.hasValueDeserializerFor(DeserializationContext.java:422)
The problem was solved after checking that the version was incompatible and upgrading jackson-databind to V2.9.6
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.6</version>
</dependency>
Possible causes.
Dependency conflict, or wrong version of dependency
Solution.
In springboot is to use jackson to use this
Dependencies.
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
Similar Posts:
- [Solved] Interpreter error /com.fasterxml.jackson.databind.JavaType
- [Solved] com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “FileSi…
- @Jsonignoreproperties does not work [How to Solve]
- com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class tonels.
- [Solved] swagger Document Error: For input string: “”
- [Solved] com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): ha
- [Solved] No serializer found for class XXX and no properties discovered to create BeanSerializer
- [Solved] Using Jackson string to convert entity to report error: mismatchedinput exception: cannot construct instance of
- [Solved] Java.io.EOFException: No content to map to Obje…
- Factory method ‘eurekaClient’ threw exception; nested exception is java.lang.RuntimeException: Failed to initialize DiscoveryClient!