Second instance of DynamoDBMapperConfig being created
See original GitHub issueIn updating to 5.1.0, on startup we’re now getting:
Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dynamoDBMapper' defined in class path resource [{Propriety class details removed}]: Unsatisfied dependency expressed through method 'dynamoDBMapper' parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig' available: expected single matching bean but found 2: dynamoDBMapperConfig,dynamoDB-DynamoDBMapperConfig
We’re creating the DynamoDBMapperConfig as per https://github.com/derjust/spring-data-dynamodb/wiki/Alter-table-name-during-runtime. Looks like something else is also now creating a DynamoDBMapperConfig.
Should these be created now in a different fashion?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top Results From Across the Web
Optional configuration settings for DynamoDBMapper
When you create an instance of DynamoDBMapper , it has certain default behaviors; you can override these defaults by using the DynamoDBMapperConfig class....
Read more >Error creating bean with name 'dynamoDB-DynamoDBMapper'
There is an Open issue raised in Github. You can also check this link, Second instance of DynamoDBMapperConfig being created.
Read more >Class DynamoDBMapperConfig - javadoc.io
New instances can be given to the mapper object on individual save, load, ... Constructs a new configuration object from two others: a...
Read more >DynamoDB Mapper Load Example and Explanation
This is a continuation of my DynamoDBMapper series. ... and optionally, a second parameter called DynamoDBMapperConfig .
Read more >How will you ensure that no two threads update the same db ...
There are two ways to ensure that lost updates phenomenon does not ... You can do this by creating a DynamoDBMapperConfig instance that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, but I need to configure the DynamoDBMapperConfig to specify table name overrides.
The
dynamoDB-DynamoDBMapperConfig
one is being created internally (and seems didn’t use to be in previous versions), and there’s no obvious new documentation on how to turn it off.Like others, I already had a
@Bean DynamoDBMapperConfig
defined.For me a combination of removing
dynamoDBMapperConfigRef
from the@EnableDynamoDBRepositories annotation
and also marking my existingDynamoDBMapperConfig
bean definition as@Primary
seemed to do the trick.