question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

software.amazon.awssdk:dynamodb:jar:2.13.52 Introduces a NoSuchFieldError: METRIC_PUBLISHERS

See original GitHub issue

Updating the aws-sdk-v2 that we are using in a maven project from 2.13.48 -> 2.13.75 specifically this package software.amazon.awssdk:dynamodb:jar:2.13.75 which looking at a mvn dependency:tree brings in transitive dependencies of AWS SDK packages of a lesser value 2.13.19 which results into the following error during the execution of our integration tests.

java.lang.NoSuchFieldError: METRIC_PUBLISHERS

Looking through the SDK source repo I found references to this metric_publishers being added during this commit, https://github.com/aws/aws-sdk-java-v2/commit/c4346d2cc8d0f02ca60c36088b17e213ec859e1b, which was first introduced in 2.13.52. When I switch back to 2.13.52 this error is still present though changing to the patch version right before that 2.13.51 doesn’t have this problem so this was introduced in the release of 2.13.52 and likely every patch version since that point. Reading the changelog of 2.13.52 I couldn’t see reference to this commit or the functionality introduced/fixed in it, https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md#21352-2020-07-07.

[INFO] +- software.amazon.awssdk:dynamodb:jar:2.13.75:compile
[INFO] |  +- software.amazon.awssdk:aws-json-protocol:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:protocol-core:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:profiles:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:sdk-core:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:auth:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:http-client-spi:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:regions:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:annotations:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:utils:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:aws-core:jar:2.13.19:compile
[INFO] |  +- software.amazon.awssdk:metrics-spi:jar:2.13.75:compile
[INFO] |  \- software.amazon.awssdk:apache-client:jar:2.13.19:runtime
[INFO] +- software.amazon.awssdk:netty-nio-client:jar:2.13.75:compile

Please advise what we are to do to be able to upgrade to these later patch versions.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tmack8001commented, Sep 10, 2020

Actually this happened again today on a newer version of dynamodb. I cleared my m2 and still reproducible. I’ll debug a bit more tomorrow or over the weekend, but other AWS ask packages aren’t having this problem for me. Maybe it is something in our maven proxy caching layer, but it is beginning to confuse me.

0reactions
tmack8001commented, Sep 17, 2020

Found that one of the many parent pom’s were locking to a specific version via a bom. This is where the version differences were coming from and why later trying again worked due to other library version upgrades going into place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enabling SDK metrics for the AWS SDK for Java
The following code snippet shows how to enable the CloudWatch metrics publisher for a request to Amazon DynamoDB. It uses the default metrics...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found