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.

Failed to register dynamoDBMapperRef

See original GitHub issue

In my project, I need to specify dynamoDBMapperRef field in @EnableDynamoDBRepositories and I just realize it doesn’t working as expected.

Expected Behavior

My project will be starting just fine and my repo will be using the registered dynamoDBMapperRef

Actual Behavior

My project failed to start and exception as below :

java.lang.IllegalArgumentException: 'beanName' must not be empty
	at org.springframework.util.Assert.hasText(Assert.java:284) ~[spring-core-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:61) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.config.RuntimeBeanReference.<init>(RuntimeBeanReference.java:50) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArgReference(BeanDefinitionBuilder.java:209) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBRepositoryConfigExtension.lambda$postProcess$0(DynamoDBRepositoryConfigExtension.java:158) ~[spring-data-dynamodb-5.2.3.jar:5.2.3]
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133) ~[na:na]
	at org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBRepositoryConfigExtension.postProcess(DynamoDBRepositoryConfigExtension.java:152) ~[spring-data-dynamodb-5.2.3.jar:5.2.3]
	at org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBRepositoryConfigExtension.postProcess(DynamoDBRepositoryConfigExtension.java:95) ~[spring-data-dynamodb-5.2.3.jar:5.2.3]
	at org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn(RepositoryConfigurationDelegate.java:163) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport.registerBeanDefinitions(RepositoryBeanDefinitionRegistrarSupport.java:107) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:384) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:383) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
	at com.example.springddb.SpringDdbApplication.main(SpringDdbApplication.java:10) ~[classes/:na]


Process finished with exit code 1

Steps to Reproduce the Problem

It is actually quite simple to reproduce I just need to create simple project, then specify dynamoDBMapperRef field in @EnableDynamoDBRepositories

@Configuration
@EnableDynamoDBRepositories(dynamoDBMapperRef = "dynamoDBMapper", basePackages = "com.example.xxxx")
public class DynamoDBConfig {
...............

Specifications

Spring Data DynamoDB Version: 5.2.3 (2.2) Spring Data Version: 2.3.0.RELEASE AWS SDK Version: 1.11.664 Java Version: 11.0.5 - Java HotSpot™ 64-Bit Server VM 11.0.5+10-LTS Platform Details: Mac OS X 10.15.2

All those information are logged by org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory on INFO level on startup. Or use java -version and mvn dependency:tree | grep -E 'spring|aws' to provide those version numbers.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boostchickencommented, May 25, 2020

Released in 5.2.4

1reaction
boostchickencommented, May 24, 2020

@felixwimpyw this looks good. Merged into develop, gonna send out a snapshot here shortly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional configuration settings for DynamoDBMapper
Use optional configuration settings for DynamoDBMapper usage with Amazon DynamoDB. ... see DynamoDBMapperConfig in the AWS SDK for Java API Reference.
Read more >
Dynamodb mapper query failing after uploading app to playstore
My android app(java) queries aws dynamodb using a "dynamodb mapper query" which works without any issues in the debug version of the app....
Read more >
Second instance of DynamoDBMapperConfig being created
In updating to 5.1.0, on startup we're now getting: Unsatisfied dependency expressed through constructor parameter 1; nested exception is ...
Read more >
Optimistic locking with version number - Amazon DynamoDB
You specify your own conditional constraints while saving data by using DynamoDBMapper with DynamoDBSaveExpression and these constraints failed. Note. DynamoDB ...
Read more >
Load, Save, Query, Delete, with DynamoDB Mapper - YouTube
In this video, I show you how to perform load, save, query and delete operations using DynamoDB Mapper in Java.Become a Better Developer ......
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