Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring boot starter parent 2.2.0.RELEASE breaking change -- server doesn't start #267

Open
raythien opened this issue Oct 23, 2019 · 17 comments

Comments

@raythien
Copy link

raythien commented Oct 23, 2019

This problem is caused because the deprecated class org.springframework.data.repository.core.support.ReflectionEntityInformation<T, ID> was removed in favor of org.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

  1. Upgrade spring boot to version 2.2.0
  2. Start the server/application

Specifications

  • Spring Data DynamoDB Version: 5.1.0
  • Spring Data Version: 2.2.0
  • AWS SDK Version: 1.11.656
  • Java Version: 11
  • Platform Details: Windows 10 Home

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.

@dragneelfps
Copy link

I am getting the same error on Spring boot 2.2.0.Release.

@boostchicken
Copy link

#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.

@boostchicken
Copy link

@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'`

@timomeinen
Copy link

@boostchicken Thank you. Works for me.

@boostchicken
Copy link

api  group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.1'

Release and on central.

@raythien
Copy link
Author

Thanks @boostchicken!

@tobiashochguertel
Copy link

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?

@boostchicken
Copy link

@tobiashochguertel I don't want to fork, I sent a PR. Up to @derjust to do something with it.

@tobiashochguertel
Copy link

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 👍.

@edwin-mendoza
Copy link

Hi - where are we with this? i am having the same issue :( are we still waiting for @derjust?

@sathorius
Copy link

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.

@timomeinen
Copy link

@sathorius You don't have a bean of type UserRepository in your application context. It has nothing to do with spring-data-dynamodb.

@jacace
Copy link

jacace commented Apr 9, 2020

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
:(

@cb-manideep
Copy link

+1

@caballeto
Copy link

Damn, I spent 3 days on it. Please mark the issue as resolved!

@boostchicken
Copy link

Use my fork. It is fixed.

@bsivalingampax8
Copy link

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

AlfonsoEsteves added a commit to AlfonsoEsteves/minesweeper-API that referenced this issue Apr 14, 2021
Adding game persistance, and an endpoint for creating new games.
For now it uses a hardcoded "Alfonso" user. This needs to be updated when authentication is implemented

I also had to update the spring-data-dynamodb dependency due to this error: derjust/spring-data-dynamodb#267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests