Spring 2.1.2 bean creation exception
See original GitHub issueExpected Behavior
Setup dynamo db
Actual Behavior
Caused by: 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.<init>()
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1270)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1164)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:974)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:848)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:574)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:514)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:471)
at org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration$DevToolsDataSourceCondition.getMatchOutcome(DevToolsDataSourceAutoConfiguration.java:164)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
... 42 more
Caused by: 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.<init>()
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:83)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1262)
... 51 more
Caused by: java.lang.NoSuchMethodException: org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperFactory.<init>()
at java.base/java.lang.Class.getConstructor0(Class.java:3350)
at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2554)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
... 52 more
Steps to Reproduce the Problem
- Start spring Boot app or run It test
Specifications
- Spring Data DynamoDB Version: 5.1.0
- Spring Data Version: 2.1.0
- AWS SDK Version: 1.11.490
- Java Version: 11
- Platform Details: Spring Boot 2.1.2 RELEASE
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 5 years ago
- Reactions:9
- Comments:27
Top Results From Across the Web
Spring boot 2.1.1 to 2.1.2: Error creating bean with name ...
I use spring-ws-core (3.0.6) on a web-service subproject that is contained in the app. I am using java 11, importing the jaxb dependencies...
Read more >Spring BeanCreationException - Baeldung
Another similar cause for the bean creation exception is Spring trying to inject a bean by type, namely by its interface, and finding...
Read more >“How-to” Guides - Spring
FailureAnalyzer is a great way to intercept an exception on startup and turn it into a human-readable message, wrapped in a FailureAnalysis ....
Read more >Spring Boot - BeanCreationException:Error creating bean with ...
[Solved]-Spring Boot - BeanCreationException:Error creating bean with name 'uploadController'-Springboot ... How about changing your code to this? @Value("${ ...
Read more >Spring Boot, Maven and Eclipse Errors and TroubleShooting ...
MultipleBagFetchException; Error : BeanCreationException - java.lang.IllegalArgumentException: At least one JPA metamodel must be present ...
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
I have Spring Boot 2.1.3 running on 5.1.0 just fine here is come of the config make sure you using the BOM for Spring Data and not hardcoding dependencies versions, Note that this will move you to the Spring Data 2.1.x release train (Lovelace)
Work’s great here
By reason of project requirements I can’t change version of Spring Boot and also should support ddl auto for all entities (only version 5.1.0 supports this feature ). I’ve fixed this problem by the following workaround , enabling override the spring beans(be careful with it!!!) you should define @Primary beans:
spring.main.allow-bean-definition-overriding=true
Then in my DynamoDBConfiguration class override DynamoDBMapperFactory bean with allowed constructor and set as primary bean for name ‘dynamoDB-DynamoDBMapper’: