aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

S3 1.11.766 java.lang.NoSuchFieldError: HAS_STREAMING_OUTPUT

Open skulljoi opened this issue 6 years ago • 9 comments

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 #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 Linux

skulljoi avatar Apr 30 '20 14:04 skulljoi

@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 avatar Apr 30 '20 18:04 debora-ito

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)

skulljoi avatar May 04 '20 10:05 skulljoi

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 avatar May 05 '20 01:05 debora-ito

Sorry misscopy the version, maybe it was 1.11.771

Em seg., 4 de mai. de 2020 às 22:26, Debora N. Ito [email protected] escreveu:

HAS_STREAMING_OUTPUT was added to AmazonS3Client in SDK version 1.11.768 (view git blame https://github.com/aws/aws-sdk-java/blame/d7476faf01b591d9a557c8c531f763a05f9b1c77/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L1457). 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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-java/issues/2307#issuecomment-623791316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6744HRF6YQL45ZGOWWMTRP5TL3ANCNFSM4MVUSZFQ .

-- []'s Juliano

http://www.google.com/profiles/skulljoi linux user: #411461 http://counter.li.org

skulljoi avatar May 05 '20 10:05 skulljoi

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

debora-ito avatar May 05 '20 17:05 debora-ito

Ok but can't find any conflicts

[INFO] +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.11.771:compile [INFO] | +- com.amazonaws:aws-java-sdk-core:jar:1.11.688:compile [INFO] | | - org.apache.httpcomponents:httpclient:jar:4.5.9:compile [INFO] | | - org.apache.httpcomponents:httpcore:jar:4.4.11:compile [INFO] | - com.amazonaws:jmespath-java:jar:1.11.688:compile [INFO] +- com.amazonaws:aws-java-sdk-s3:jar:1.11.771:compile [INFO] | - com.amazonaws:aws-java-sdk-kms:jar:1.11.688:compile [INFO] +- com.amazonaws:aws-java-sdk-secretsmanager:jar:1.11.771:compile [INFO] +- com.amazonaws:aws-kinesisanalytics-runtime:jar:1.1.0:compile [INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.7:compile [INFO] | - org.apache.flink:flink-shaded-jackson:jar:2.7.9-4.0:compile [INFO] +- org.apache.flink:flink-connector-kinesis_2.12:jar:1.10.0:compile [INFO] | +- com.google.guava:guava:jar:18.0:compile [INFO] | +- commons-io:commons-io:jar:2.4:compile [INFO] | +- org.apache.commons:commons-lang3:jar:3.3.2:compile [INFO] | +- commons-codec:commons-codec:jar:1.10:compile [INFO] | +- software.amazon.ion:ion-java:jar:1.0.2:compile [INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.10.1:compile [INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.1:compile [INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.10.1:compile [INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.10.1:compile [INFO] | +- joda-time:joda-time:jar:2.5:compile [INFO] | +- commons-lang:commons-lang:jar:2.6:compile [INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile [INFO] | - org.apache.flink:force-shading:jar:1.10.0:compile [INFO] +- org.apache.flink:flink-streaming-java_2.12:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-core:jar:1.10.0:compile [INFO] | | +- org.apache.flink:flink-annotations:jar:1.10.0:compile [INFO] | | +- org.apache.flink:flink-metrics-core:jar:1.10.0:compile [INFO] | | +- com.esotericsoftware.kryo:kryo:jar:2.24.0:compile [INFO] | | | - com.esotericsoftware.minlog:minlog:jar:1.2:compile [INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile [INFO] | | - org.apache.commons:commons-compress:jar:1.18:compile [INFO] | +- org.apache.flink:flink-runtime_2.12:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-clients_2.12:jar:1.10.0:compile [INFO] | | - org.apache.flink:flink-optimizer_2.12:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-shaded-guava:jar:18.0-9.0:compile [INFO] | +- org.apache.commons:commons-math3:jar:3.5:compile [INFO] | +- org.slf4j:slf4j-api:jar:1.7.15:compile [INFO] | - com.google.code.findbugs:jsr305:jar:1.3.9:compile [INFO] +- com.amazonaws:aws-kinesisanalytics-flink:jar:1.1.0:compile [INFO] | +- com.amazonaws:aws-java-sdk-iam:jar:1.11.688:compile [INFO] | +- com.amazonaws:aws-java-sdk-kinesis:jar:1.11.688:compile [INFO] | - log4j:log4j:jar:1.2.17:compile [INFO] +- com.amazonaws:aws-java-sdk-logs:jar:1.11.688:compile [INFO] +- javax.xml.bind:jaxb-api:jar:2.4.0-b180830.0359:compile [INFO] | - javax.activation:javax.activation-api:jar:1.2.0:compile [INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.6.2:test [INFO] | +- org.apiguardian:apiguardian-api:jar:1.1.0:test [INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:test [INFO] | - org.junit.platform:junit-platform-commons:jar:1.6.2:test [INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.6.2:test [INFO] | +- org.junit.platform:junit-platform-engine:jar:1.6.2:test [INFO] | - junit:junit:jar:4.13:compile [INFO] +- org.apache.flink:flink-test-utils_2.12:jar:1.10.0:test [INFO] | +- org.apache.flink:flink-test-utils-junit:jar:1.10.0:test [INFO] | - org.apache.curator:curator-test:jar:2.12.0:test [INFO] | - org.apache.zookeeper:zookeeper:jar:3.4.8:test [INFO] | +- jline:jline:jar:0.9.94:test [INFO] | - io.netty:netty:jar:3.7.0.Final:test [INFO] +- org.apache.flink:flink-runtime_2.12:jar:tests:1.10.0:test [INFO] | +- org.apache.flink:flink-java:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-queryable-state-client-java:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-hadoop-fs:jar:1.10.0:compile [INFO] | +- org.apache.flink:flink-shaded-netty:jar:4.1.39.Final-9.0:compile [INFO] | +- org.apache.flink:flink-shaded-asm-7:jar:7.1-9.0:compile [INFO] | +- commons-cli:commons-cli:jar:1.3.1:compile [INFO] | +- org.javassist:javassist:jar:3.24.0-GA:compile [INFO] | +- org.scala-lang:scala-library:jar:2.12.7:compile [INFO] | +- com.typesafe.akka:akka-actor_2.12:jar:2.5.21:compile [INFO] | | +- com.typesafe:config:jar:1.3.3:compile [INFO] | | - org.scala-lang.modules:scala-java8-compat_2.12:jar:0.8.0:compile [INFO] | +- com.typesafe.akka:akka-stream_2.12:jar:2.5.21:compile [INFO] | | +- org.reactivestreams:reactive-streams:jar:1.0.2:compile [INFO] | | - com.typesafe:ssl-config-core_2.12:jar:0.3.7:compile [INFO] | | - org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.1.1:compile [INFO] | +- com.typesafe.akka:akka-protobuf_2.12:jar:2.5.21:compile [INFO] | +- com.typesafe.akka:akka-slf4j_2.12:jar:2.5.21:compile [INFO] | +- org.clapper:grizzled-slf4j_2.12:jar:1.3.2:compile [INFO] | +- com.github.scopt:scopt_2.12:jar:3.5.0:compile [INFO] | +- org.xerial.snappy:snappy-java:jar:1.1.4:compile [INFO] | +- com.twitter:chill_2.12:jar:0.7.6:compile [INFO] | | - com.twitter:chill-java:jar:0.7.6:compile [INFO] | - org.lz4:lz4-java:jar:1.5.0:compile

Em ter., 5 de mai. de 2020 às 14:09, Debora N. Ito [email protected] escreveu:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-java/issues/2307#issuecomment-624184561, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN674YGOTTR332DYNM4KH3RQBB4XANCNFSM4MVUSZFQ .

-- []'s Juliano

http://www.google.com/profiles/skulljoi linux user: #411461 http://counter.li.org

skulljoi avatar May 05 '20 17:05 skulljoi

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 avatar May 05 '20 18:05 debora-ito

Have a property aws.sdk.version Then apply to all aws resources using {aws.sdk.version}

On Tue, May 5, 2020, 15:37 Debora N. Ito [email protected] wrote:

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/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-java/issues/2307#issuecomment-624233162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6743SMNZO6IX65NKH5SDRQBMF7ANCNFSM4MVUSZFQ .

skulljoi avatar May 05 '20 18:05 skulljoi

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.

debora-ito avatar May 12 '20 21:05 debora-ito