question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Second instance of DynamoDBMapperConfig being created

See original GitHub issue

In 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:open
  • Created 5 years ago
  • Comments:14

github_iconTop GitHub Comments

5reactions
GynnRickerbyNZPostcommented, Feb 7, 2019

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.

4reactions
rratliffcommented, Apr 30, 2019

Like others, I already had a @Bean DynamoDBMapperConfig defined.

For me a combination of removing dynamoDBMapperConfigRef from the @EnableDynamoDBRepositories annotation and also marking my existing DynamoDBMapperConfig bean definition as @Primary seemed to do the trick.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found