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:
This is my PostgrsJpaConfig class: PostgresJpaConfig class
Your version of spring-data-commons is too old, and that version doesn't have the BootstrapMode class. Please try upgrading it to 2.2.0.RELEASE as you have for the other spring dependencies. It's probably a good idea to define a version property in your pom:
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.
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. Show activity on this post. 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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With