Open danieleforberg opened 5 years ago
I am getting the same error even with spring boot 2.1.0.RELEASE
Ok worked for me using 5.0.4 version and 2.0.9 of Spring data commons and 2.1.2 spring boot version. Maybe works if downgrading Spring data commons to The version supported 5.1.0 have not tested that yet
Skaffa Outlook för Androidhttps://aka.ms/ghei36
From: Paweł notifications@github.com Sent: Sunday, February 10, 2019 10:19:24 AM To: derjust/spring-data-dynamodb Cc: Daniel Förberg; Author Subject: Re: [derjust/spring-data-dynamodb] Spring 2.1.2 bean creation exception (#237)
I am getting the same error even with spring boot 2.1.0.RELEASE
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/derjust/spring-data-dynamodb/issues/237#issuecomment-462116561, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhaQuBx4DRMjvSRvM_uHUm8jEmHsoQmgks5vL-QcgaJpZM4avrjz.
I am having this issue too. Seems like a blocker to use this library with Spring Boot 2.1.
@danieleforberg what did you do to downgrade the versions in Maven or Gradle?
I have tried but did not have any success wheter is not a configuration issue it is bug that stops using 5.1.0 not working as exspected. It says it should support this version but not. Do you need more information from me? Config?
Skaffa Outlook för Androidhttps://aka.ms/ghei36
From: Ken Dallmeyer notifications@github.com Sent: Wednesday, February 13, 2019 4:12:11 AM To: derjust/spring-data-dynamodb Cc: Daniel Förberg; Mention Subject: Re: [derjust/spring-data-dynamodb] Spring 2.1.2 bean creation exception (#237)
I am having this issue too. Seems like a blocker to use this library with Spring Boot 2.1.
@danieleforberghttps://github.com/danieleforberg what did you do to downgrade the versions in Maven or Gradle?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/derjust/spring-data-dynamodb/issues/237#issuecomment-463039366, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhaQuEM4juaLuVfXuSGER-D84MdbUluhks5vM4KLgaJpZM4avrjz.
In Gradle, by manually adding org.springframework.data:spring-data-commons:2.0.11.RELEASE
, it overwrote what spring boot 2.1 was using so that it is compatible with the 5.0.4
version.
compile "com.amazonaws:aws-java-sdk-dynamodb:1.11.490"
compile "org.springframework.data:spring-data-commons:2.0.11.RELEASE"
compile "com.github.derjust:spring-data-dynamodb:5.0.4"
Ok but 5.1.0 does not work
Skaffa Outlook för Androidhttps://aka.ms/ghei36
From: Ken Dallmeyer notifications@github.com Sent: Wednesday, February 13, 2019 4:44:58 PM To: derjust/spring-data-dynamodb Cc: Daniel Förberg; Mention Subject: Re: [derjust/spring-data-dynamodb] Spring 2.1.2 bean creation exception (#237)
In Gradle, by manually adding org.springframework.data:spring-data-commons:2.0.11.RELEASE, it overwrote what spring boot 2.1 was using so that it is compatible with the 5.0.4 version.
compile "com.amazonaws:aws-java-sdk-dynamodb:1.11.490"
compile "org.springframework.data:spring-data-commons:2.0.11.RELEASE"
compile "com.github.derjust:spring-data-dynamodb:5.0.4"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/derjust/spring-data-dynamodb/issues/237#issuecomment-463248968, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhaQuNg5kvrYc-Yv_-3jQt5MypO7fdqEks5vNDL6gaJpZM4avrjz.
It is the same as #230 even if it not happen specifically in a test. It will happen both in test and when starting boot. Seems wrong constructor definition in factorybean
Skaffa Outlook för Androidhttps://aka.ms/ghei36
From: Ken Dallmeyer notifications@github.com Sent: Wednesday, February 13, 2019 4:44:58 PM To: derjust/spring-data-dynamodb Cc: Daniel Förberg; Mention Subject: Re: [derjust/spring-data-dynamodb] Spring 2.1.2 bean creation exception (#237)
In Gradle, by manually adding org.springframework.data:spring-data-commons:2.0.11.RELEASE, it overwrote what spring boot 2.1 was using so that it is compatible with the 5.0.4 version.
compile "com.amazonaws:aws-java-sdk-dynamodb:1.11.490"
compile "org.springframework.data:spring-data-commons:2.0.11.RELEASE"
compile "com.github.derjust:spring-data-dynamodb:5.0.4"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/derjust/spring-data-dynamodb/issues/237#issuecomment-463248968, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AhaQuNg5kvrYc-Yv_-3jQt5MypO7fdqEks5vNDL6gaJpZM4avrjz.
@derjust could you please do something about this issue.
We got the same problem when upgrading to the latest version of springboot
We are also experiencing a similar problem. springboot 2.1.2.RELEASE and spring-data-dynamodb.version 5.1.0
Here the same. Its really a bug issue because spring boot 2.1.x is needed to get all the latest goodies from spring-security-oauth2-jose
5.1.0 only works with LoveLace, if you are using something before it it will not work
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)
ext {
springDataVersion = 'Lovelace-SR5'
}
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.3.RELEASE")
classpath "io.spring.gradle:dependency-management-plugin:1.0.6.RELEASE"
}
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom "org.springframework.data:spring-data-releasetrain:${springDataVersion}"
}
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-web"
implementation group: 'com.github.derjust', name: 'spring-data-dynamodb', version: '5.1.0'
implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.497'
}
Work's great here
Also you do have to setup your DynamoMapper, here is a snippet
@Bean
public AmazonDynamoDB amazonDynamoDB()
{
Region region = Regions.getCurrentRegion();
if(region == null) {
region = RegionUtils.getRegion(this.region); // This is brought in from a prop file, do it however you want
}
return AmazonDynamoDBClientBuilder.standard().withRegion(region.getName()).build();
}
@Bean
@Primary
public DynamoDBMapper dynamoDBMapper(AmazonDynamoDBClient amazonDynamoDBClient, DynamoDBMapperConfig dynamoDBMapperConfig)
{
return new DynamoDBMapper(amazonDynamoDBClient, dynamoDBMapperConfig);
}
@Bean
public DynamoDBMapperConfig dynamoDBMapperConfig() {
DynamoDBMapperConfig.Builder builder = new DynamoDBMapperConfig.Builder();
builder.setPaginationLoadingStrategy(DynamoDBMapperConfig.PaginationLoadingStrategy.LAZY_LOADING);
builder.setTypeConverterFactory(DynamoDBTypeConverterFactory.standard());
return builder.build();
}
@Bean
public DynamoDB dynamoDB(AmazonDynamoDB amazonDynamoDB)
{
return new DynamoDB(amazonDynamoDB);
}
Also tested against Moore M2, works good.
Cannot reconstruct your success. Using maven with spring boot 2.1.3 Also added dependency:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Lovelace-SR5</version>
</dependency>
Also used your config ... still getting the same error
@boostchicken Also tried the example project from #230 (https://github.com/pluttrell/spring-data-dynamodb-5.1.0-issue) with your example configuration and still getting same error
Hi @tiagocpeixoto,
i tried your fix and it actually solved the issue for me. So i can confirm that your PR fixes the issue!
Best regards,
@boostchicken couldn't make it work even with the changes you suggested. Getting the same error.
Anyone else got it working with Spring Boot 2.1.2 or 2.1.3?
@gruutak It's impossible for me to say why this works for me and couple others and not for you. I'd be curious to look at your code and see where it differs, totally understand if that's not possible. There is the open PR for @tiagocpeixoto that you could checkout and build locally and see if it fixes your issue.
hello im trying to use this lib with QueryByExampleExecutor, i.e. Query by Example https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example and fail with this error>
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'gatesServiceImpl': Unsatisfied dependency expressed through field 'eventsRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property exists found for type Events!
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1341) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:572) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
at com.mobilenik.rekonpeople.RekonPeopleApplication.main(RekonPeopleApplication.java:19) [classes!/:0.0.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [rekonpeopleApi-0.0.1.jar:0.0.1]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [rekonpeopleApi-0.0.1.jar:0.0.1]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [rekonpeopleApi-0.0.1.jar:0.0.1]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [rekonpeopleApi-0.0.1.jar:0.0.1]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property exists found for type Events!
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
... 27 common frames omitted
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property exists found for type Events!
at org.springframework.data.mapping.PropertyPath.
Specifications Spring Data DynamoDB Version: 5.0.4 AWS SDK Version: 1.11.163 Java Version: 8 Platform Details: Spring Boot 2.0.5 RELEASE
Can you help me???!
@boostchicken Unfortunately, I can't share the code with you.
Trying the fix I got the same error when running the tests, but a slightly different error running the app with the versions you recommended above and the exact same setup for DynamoMapper:
-java.lang.NoSuchMethodException: org.socialsignin.spring.data.dynamodb.repository.config.DynamoDBMapperFactory.<init>()
at java.base/java.lang.Class.getConstructor0(Class.java:3350) ~[na:na]
at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2554) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
... 30 common frames omitted
Wrapped 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) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1279) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
... 29 common frames omitted
Wrapped 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:1287) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:991) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:865) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:574) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:514) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:227) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1411) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1210) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1167) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
... 17 common frames omitted
Wrapped by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'traceHookRegisteringBeanDefinitionRegistryPostProcessor' defined in class path resource [org/springframework/cloud/sleuth/instrument/reactor/TraceReactorAutoConfiguration$TraceReactorConfiguration.class]: Unsatisfied dependency expressed through method 'traceHookRegisteringBeanDefinitionRegistryPostProcessor' parameter 0; nested exception is 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.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1305) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1144) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at com.ibanking.enterprise.APIStarter.main(APIStarter.java:24) ~[main/:na]
Ok, I got it working with the fix. Turns out spring-data-redis was messing stuff up. I had it configured to use a specific version. Started working when I removed the version so it would use the mavenBom
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':
@Primary
@Bean(name = "dynamoDB-DynamoDBMapper")
public DynamoDBMapperFactory dynamoDBMapperFactory() {
return new DynamoDBMapperFactory(amazonDynamoDB(), dynamoDBMapperConfig());
}
Fixing the version of spring-beans dependency to 5.1.6.RELEASE fixes this issue for me but surfaces more issues...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.6.RELEASE</version>
</dependency>
Updating to spring-boot ~5.1.4.RELEASE~ 2.1.4.RELEASE resolved this issue for us
Edit: version number typo
Expected Behavior
Setup dynamo db
Actual Behavior
Steps to Reproduce the Problem
Specifications
All those information are logged by
org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory
onINFO
level on startup. Or usejava -version
andmvn dependency:tree | grep -E 'spring|aws'
to provide those version numbers.