Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LeoAugust19 opened this issue Aug 3, 2018 · 5 comments

Comments

@LeoAugust19
Copy link

LeoAugust19 commented Aug 3, 2018

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

@LeoAugust19
Copy link
Author

@cogmission , May I pull a request to fix this issue?

@cogmission
Copy link
Collaborator

@LeoAugust19
Yes, of course!

Thank you for your interest in making HTM.java the best it can be!
David

@LeoAugust19
Copy link
Author

@cogmission Thanks a lot, I will do that.

@LeoAugust19
Copy link
Author

@cogmission Please forgive me for asking you a further question.

We provide the above two types of information:
A: The missing method and conflicting jars are identifed by static analysis.
B: Stack trace is triggered by test case.

Which type of information is more useful for you to confirm it's a bug?

@cogmission
Copy link
Collaborator

@LeoAugust19

Hi, I’m on vacation right now. Will be back toward end of August... Please hold tight. Thanks, David

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

No branches or pull requests

2 participants