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

“NoSuchMethodErrors” due to multiple versions of com.fasterxml.jackson.core:jackson-databind #15378

Open
Bing-ok opened this issue Nov 15, 2023 · 0 comments

Comments

@Bing-ok
Copy link

Bing-ok commented Nov 15, 2023

Issue description

Hi, there are multiple versions of com.fasterxml.jackson.core:jackson-databind in druid-server:26.0.0. As shown in the following dependency tree, according to Maven "nearest wins" strategy, only com.fasterxml.jackson.core:jackson-databind:2.10.5.1 can be loaded, com.fasterxml.jackson.core:jackson-databind:2.9.9 and com.fasterxml.jackson.core:jackson-databind:2.10.5 will be shadowed.

However, several methods defined in shadowed version com.fasterxml.jackson.core:jackson-databind:2.9.9 are referenced by client project via org.apache.druid:druid-processing:26.0.0 but missing in the actually loaded version com.fasterxml.jackson.core:jackson-databind:2.10.5.1.

For instance, the following missing method(defined in com.fasterxml.jackson.core:jackson-databind:2.9.9 and com.fasterxml.jackson.core:jackson-databind:2.10.5) are actually referenced by druid-server, which will introduce a runtime error(i.e., "NoSuchMethodError") into druid-server.

  1. <com.fasterxml.jackson.databind.ser.std.ToStringSerializer: void serialize(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider)>
paths--
<org.apache.druid.jackson.DruidServiceSerializer: void serialize(org.apache.druid.discovery.DruidService,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider)> org.apache.druid:druid-server:26.0.0;
<com.fasterxml.jackson.databind.ser.std.ToStringSerializer: void serialize(java.lang.Object,com.fasterxml.jackson.core.JsonGenerator,com.fasterxml.jackson.databind.SerializerProvider)>

Suggested fixing solutions:
Change direct dependency com.fasterxml.jackson.core:jackson-databind from 2.10.5.1 to 2.9.9. Because version 2.9.9 includes the above missing methods and is compatible with other versions of com.fasterxml.jackson.core:jackson-databind in the project.

Please let me know if you agree to this solution? I can submit a PR to fix it.

Thank you very much for your attention.
Best regards,

Dependency tree --


[INFO] |  |  |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  \- (org.apache.commons:commons-collections4:jar:4.2:compile - omitted for duplicate)
[INFO] |  +- net.thisptr:jackson-jq:jar:0.0.10:compile
[INFO] |  |  +- org.jruby.joni:joni:jar:2.1.27:compile
[INFO] |  |  |  \- org.jruby.jcodings:jcodings:jar:1.0.43:compile
[INFO] |  |  \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.5.1:compile - version managed from 2.9.9; omitted for duplicate)
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.3.0:compile
[INFO] |  |  +- net.minidev:json-smart:jar:2.3:compile
[INFO] |  |  |  \- net.minidev:accessors-smart:jar:1.2:compile
[INFO] |  |  |     \- (org.ow2.asm:asm:jar:9.3:compile - version managed from 5.0.4; omitted for duplicate)
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.36:compile - version managed from 1.7.25; omitted for duplicate)
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

1 participant