Skip to content

java.lang.NoSuchMethodError caused by dependency conflict issue due to multiple versions of com.fasterxml.jackson.core:jackson-core:jar #540

Description

@LeoAugust19

Hi, there are multiple versions of com.fasterxml.jackson.core:jackson-core:jar in org.numenta:htm.java:jar:0.6.13. As shown in the following dependency tree, based on "Maven's nearest wins strategy", only com.fasterxml.jackson.core:jackson-core:jar:2.4.4 will be loaded and the other conflicting versions will be shadowed, during the packaging process.

However, method <com.fasterxml.jackson.core.JsonParser: java.lang.String nextFieldName()> only exists in jackson-core 2.5.3 and not included in the loaded jackson-core:jar:2.4.4. As a result, an exception will be thrown with the following stack trace, when your project invoking the missing method.

Stack trace

Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.nextFieldName()Ljava/lang/String;
at org.nustaq.serialization.coders.FSTJsonDecoder.readObjectHeaderTag(FSTJsonDecoder.java:329)
at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:340)
at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:327)
at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:298)
at org.numenta.nupic.Parameters.readForNetwork(Parameters.java:1174)

Dependency tree

org.numenta:htm.java:jar:0.6.13
+- joda-time:joda-time:jar:2.5:compile
+- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile
+- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
+- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
| +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile - omitted for conflict with 2.4.4)
| - (com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile - omitted for duplicate)
+- de.ruedigermoeller:fst:jar:2.45:compile
| +- (com.fasterxml.jackson.core:jackson-core:jar:2.5.3:compile - omitted for conflict with 2.4.4)
| +- org.javassist:javassist:jar:3.19.0-GA:compile
| - org.objenesis:objenesis:jar:2.1:compile
- algorithmfoundry:algorithmfoundry-shade-culled:jar:1.3:compile

Solution

Upgrade jackson (include jackson-annotations, jackson-core and jackson-databind) to version 2.5.3 to keep consistent with de.ruedigermoeller:fst.

Thanks

Regards,
Leo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions