Issue
When I run my Spring Boot 2.0.0 application with the current latest version of spring-data-dynamodb (v5.1.0) I get the following error at runtime.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dynamoDB-DynamoDBMapper': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperFactory]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperFactory.()
I have tried the following things:
- Adding a DynamoDBMapperFactory bean to my configuration class and making it primary
- Different combinations of AWSCredentials, DynamoDBMapperConfig, DynamoDBMapper and AmazonDynamoDB bean configurations (e.g. removing them, making them primary, giving them names and explicitly referring to them)
- Different combintations of config passed to the EnableDynamoDBRepositories annotation
Solution
It turned out that spring-data-dynamo v5.1.0 was not compatible with my version of Spring Boot (2.0.0)
Downgrading the spring-data-dynamo library to v5.0.4 fixed my issues.
Answered By - Sean Dawson
Answer Checked By - Pedro (JavaFixing Volunteer)