java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode

BlueScoreMan :

I'm doing this project with spring boot and I tried to write some tests but sadly I get this exception stacktrace:

java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [somepath/config/PostgresJpaConfig.class]; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/repository/config/BootstrapMode

I looked if some sort of dependency was missing in my build.gradle, but I don't think so. The BootstrapMode thingy doesn't exist anywhere, not even on the Central Maven Repository. I searched through my entire project with IntelliJ for any type of BootstrapMode appearance, without any luck.

These are my gradle dependencies: Gradle Dependencies

This is my PostgrsJpaConfig class: PostgresJpaConfig class

BlueScoreMan :

TL;DR: I was mixing up Spring versions. Overriding one version with another, which you shouldn't do.

Instead of using the org.springframework.data dependency, I should use org.springframework.boot:spring-boot-starter-data-jpa.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=36315&siteId=1