Failed to register dynamoDBMapperRef
See original GitHub issueIn 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:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Released in 5.2.4
@felixwimpyw this looks good. Merged into develop, gonna send out a snapshot here shortly