java.lang.NoSuchFieldError: CLIENT_ENDPOINT for Amazon ECS

Viewed 8084

I tried to list the ECS clusters using the code as follow:

AmazonECS = amazonECS AmazonECSClientBuilder.standard().withRegion(region).withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build():
amazonECS.listClusters();

However, it gave the error

java.lang.NoSuchFieldError: CLIENT_ENDPOINT

The error stack is something like this:

com.amazonaws.services.ecs.AmazonECSClient in executeListClusters at line 2220 com.amazonaws.services.ecs.AmazonECSClient in listClusters at line 2202 com.amazonaws.services.ecs.AmazonECSClient in listClusters at line 2245

I am not too sure why this error occurred as the other Amazon services did not give me any similar error whatsoever and I have set the region previously based on the client's preference. Any ideas?

3 Answers

I had different version for SQS and S3 in pom.xml. After I updated those to same versions, it worked.

It depends on where to look for these versions mismatch.

I am using spark to connect to secrets manager and thus we have 2 places to look at.

  1. My Application dependencies (build.gradle)
  2. spark.yarn.jars

The versions in the above 2 places should match and then it started working

Related