aws / aws-sdk-java

The official AWS SDK for Java 1.x (In Maintenance Mode, End-of-Life on 12/31/2025). The AWS SDK for Java 2.x is available here: https://github.com/aws/aws-sdk-java-v2/
https://aws.amazon.com/sdkforjava
Apache License 2.0
4.13k stars 2.83k forks source link

java.lang.NoSuchMethodError: com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder #2991

Closed Lalitha333 closed 1 year ago

Lalitha333 commented 1 year ago

Describe the bug

We are facing below issue when creating the AWS SQS builder on EMR:

java.lang.NoSuchMethodError: com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder.withRegion(Lcom/amazonaws/regions/Regions;)Lcom/amazonaws/client/builder/AwsClientBuilder;

We can run it locally but not on EMR. 1.12.487 is the sdk version we are using.

Expected Behavior

We are facing below issue when creating the AWS SQS builder on EMR:

java.lang.NoSuchMethodError: com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder.withRegion(Lcom/amazonaws/regions/Regions;)Lcom/amazonaws/client/builder/AwsClientBuilder;

We can run it locally but not on EMR. 1.12.487 is the sdk version we are using.

Current Behavior

Able to create the SQS builder without any issue.

Reproduction Steps

deploying our jar on EMR

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

1.12.487

JDK version used

1.8

Operating System and version

EMR

debora-ito commented 1 year ago

NoSuchMethodError indicates a version mismatch of the core and sqs modules. Ideally all SDK modules should be in the same version.

Using the BOM artifact helps to achieve this, for more info check our blog post - https://aws.amazon.com/blogs/developer/managing-dependencies-with-aws-sdk-for-java-bill-of-materials-module-bom/.