Sabarish
Sabarish

Reputation: 141

NoSuchMethodError on AmazonDynamoDB client Configuration

All,

I am developing a series of REST services using JERSEY which talk to Amazon DynamoDB service using AWS SDK. The REST services are hosted in TOMCAT Server. However while executing the following code

AWSCredentials credentials = new BasicAWSCredentials("Test", "Test");       
AmazonDynamoDBClient dynamoClient = new AmazonDynamoDBClient(credentials);

I get the following exception:

Mar 08, 2015 6:28:25 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: com.amazonaws.ClientConfiguration.<init>(Lcom/amazonaws/ClientConfiguration;)
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.adjustClientConfiguration(AmazonDynamoDBClient.java:397)
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:302)
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.<init>(AmazonDynamoDBClient.java:283)

This code seems to work in a normal java application. Any help is appreciated.

Upvotes: 1

Views: 1463

Answers (1)

Stephen L.
Stephen L.

Reputation: 509

Looks like a different version of the lib is used at the runtime. Check out the version of JAR that contains AmazonDynamoDBClient and make sure that this class has the proper method. Then check out the version that is used at the runtime. It might be connected with Tomcat configuration. I faced with a similar issue related to JodaTime once I used it in WebLogic.

Upvotes: 1

Related Questions