Skip to content

S3 1.11.766 java.lang.NoSuchFieldError: HAS_STREAMING_OUTPUT #2307

New issue

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

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

Already on GitHub? # to your account

Closed
skulljoi opened this issue Apr 30, 2020 · 9 comments
Closed

S3 1.11.766 java.lang.NoSuchFieldError: HAS_STREAMING_OUTPUT #2307

skulljoi opened this issue Apr 30, 2020 · 9 comments
Labels
guidance Question that needs advice or information.

Comments

@skulljoi
Copy link

Update the libraries today and found a problem when try to download S3 Object content

Describe the bug

s3Client.getObject(bucketName, path);
after calling this an exception is throw
java.lang.NoSuchFieldError: HAS_STREAMING_OUTPUT
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1457)
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1344)

Expected Behavior

It just have to bring the S3Object

Current Behavior

An Exception is Throw

Steps to Reproduce

not sure, I just updated my libraries

Possible Solution

Not sure, but for me just downgrade again.

Context

break my dev and production environment

Your Environment

  • AWS Java SDK version used: 1.11.766

  • JDK version used:
    openjdk version "13-ea" 2019-09-17
    OpenJDK Runtime Environment (build 13-ea+32)
    OpenJDK 64-Bit Server VM (build 13-ea+32, mixed mode, sharing)

  • Operating System and version: linux from docker openjdk:13-alpine
    Linux 07e7bc1313fb 4.19.76-linuxkit Avoid spurious warning when uploading empty file using an InputStream. #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 Linux

@skulljoi skulljoi added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 30, 2020
@debora-ito
Copy link
Member

debora-ito commented Apr 30, 2020

@skulljoi can you provide a code sample showing how you created the client?
Can you also provide the full stacktrace?

Update the libraries today and found a problem when try to download S3 Object content

What was the version you updated from?

@debora-ito debora-ito added response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 30, 2020
@skulljoi
Copy link
Author

skulljoi commented May 4, 2020

AmazonS3ClientBuilder.standard().withRegion(Regions.EU_WEST_1).build();
Working SDK version: 1.11.734

fullstacktrace:
java.lang.NoSuchFieldError: HAS_STREAMING_OUTPUT
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1457)
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1344)
at MyOtherClass.myOtherMethod(MyOtherClass.java:123)
at MyClass.myMethod(MyClass.java:175)

@debora-ito debora-ito added guidance Question that needs advice or information. and removed response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. bug This issue is a bug. labels May 5, 2020
@debora-ito
Copy link
Member

HAS_STREAMING_OUTPUT was added to AmazonS3Client in SDK version 1.11.768 (view git blame). You said you're using version 1.11.766, so it looks like you have a conflict of versions in your dependency tree. You can check by using

mvn dependency:tree

@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label May 5, 2020
@skulljoi
Copy link
Author

skulljoi commented May 5, 2020 via email

@debora-ito debora-ito removed the closing-soon This issue will close in 2 days unless further comments are made. label May 5, 2020
@debora-ito
Copy link
Member

Well the cause is still the same. Check for version conflicts in your dependency tree.

@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label May 5, 2020
@skulljoi
Copy link
Author

skulljoi commented May 5, 2020 via email

@debora-ito
Copy link
Member

This is a version conflict:

[INFO] +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.11.771:compile
[INFO] | +- com.amazonaws:aws-java-sdk-core:jar:1.11.688:compile

Maven is resolving to an older version of core, it should be 1.11.771. Mixing different versions of core and client can lead to runtime errors.

How are you managing the dependency versions? Using BOM helps in this case - https://aws.amazon.com/blogs/developer/managing-dependencies-with-aws-sdk-for-java-bill-of-materials-module-bom/

@debora-ito debora-ito added closing-soon This issue will close in 2 days unless further comments are made. and removed closing-soon This issue will close in 2 days unless further comments are made. labels May 5, 2020
@skulljoi
Copy link
Author

skulljoi commented May 5, 2020 via email

@github-actions github-actions bot removed the closing-soon This issue will close in 2 days unless further comments are made. label May 7, 2020
@debora-ito
Copy link
Member

Using BOM would help in this case, the version is defined in one place for all the SDK modules. Check the link in my previous comment.

I'll go ahead and close this. Feel free to reach out if you have any other question.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants