Open raythien opened 5 years ago
I am getting the same error on Spring boot 2.2.0.Release.
https://github.com/derjust/spring-data-dynamodb/pull/270
Feel free to check out from my repo and build locally. If there is a need I can start taking over maintenance from @derjust since he has been very inactive.
@raythien @dragneelfps
Published to OSSRH Snapshots give it a go and let me know how it works.
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
`api group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.0-SNAPSHOT'`
@boostchicken Thank you. Works for me.
api group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.1'
Release and on central.
Thanks @boostchicken!
Has development stopped here? or does @derjust do you search for new maintainers? I think this isn't a good way when we don't work together and everyone forks, to fix a bug and no pull request goes back into the origin?
@tobiashochguertel I don't want to fork, I sent a PR. Up to @derjust to do something with it.
I understand, I had in the past same issues with an open source project on my github channel, I was a long time ill and now I'm back and was able to care about pull request in my project. š¤ We have to wait for @derjust . He did a nice project š.
Hi - where are we with this? i am having the same issue :( are we still waiting for @derjust?
I have problem with same config Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in com.techcentrix.user.config.dbmigrations.InitialSetup required a bean of type 'com.techcentrix.user.repository.UserRepository' that could not be found.
@sathorius You don't have a bean of type UserRepository
in your application context. It has nothing to do with spring-data-dynamodb.
I just spent a couple of days troubleshooting this. It's a shame that the fix PR has not been accepted and that the issue is still open since October 2019 :(
+1
Damn, I spent 3 days on it. Please mark the issue as resolved!
Use my fork. It is fixed.
For this version implementation 'io.github.boostchicken:spring-data-dynamodb:5.2.5' , which version of spring boot I should use. I am using spring boot version 2.4.3, getting ClassNotFoundException
This problem is caused because the deprecated class
org.springframework.data.repository.core.support.ReflectionEntityInformation<T, ID>
was removed in favor oforg.springframework.data.repository.core.support.PersistentEntityInformation<T, ID>
.Expected Behavior
Spring server (Tomcat)/application loads normally.
Actual Behavior
Dynamo DB shows the following warning:
WARN 25900 --- [ main] o.s.s.d.d.r.s.DynamoDBRepositoryFactory : This Spring Data DynamoDB implementation might not be compatible with the available Spring Data classes on the classpath!
Then, the following exception is thrown:
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/core/support/ReflectionEntityInformation at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) ~[na:na] at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) ~[na:na] at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802) ~[na:na] at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700) ~[na:na] at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623) ~[na:na] at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na] at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBEntityMetadataSupport.getEntityInformation(DynamoDBEntityMetadataSupport.java:125) ~[spring-data-dynamodb-5.1.0.jar:5.1.0] at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getEntityInformation(DynamoDBRepositoryFactory.java:104) ~[spring-data-dynamodb-5.1.0.jar:5.1.0] at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getDynamoDBRepository(DynamoDBRepositoryFactory.java:128) ~[spring-data-dynamodb-5.1.0.jar:5.1.0] at org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory.getTargetRepository(DynamoDBRepositoryFactory.java:150) ~[spring-data-dynamodb-5.1.0.jar:5.1.0] at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:312) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:297) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE] at org.springframework.data.util.Lazy.getNullable(Lazy.java:212) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE] at org.springframework.data.util.Lazy.get(Lazy.java:94) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE] at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:300) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) ~[spring-beans-5.2.0.RELEASE.jar:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1799) ~[spring-beans-5.2.0.RELEASE.jar:5.2.0.RELEASE] ... 188 common frames omitted
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.