I am using CRUDRepository to perform crud operations using JPA , but I am getting this error:
java.lang.NoSuchMethodError: org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.registerIfNotAlreadyRegistered
Please help.
I am using CRUDRepository to perform crud operations using JPA , but I am getting this error:
java.lang.NoSuchMethodError: org.springframework.data.jpa.repository.config.JpaRepositoryConfigExtension.registerIfNotAlreadyRegistered
Please help.
It comes from this commit:
So you'll need at least spring-data-commons 1.10.0.RELEASE:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.10.0.RELEASE</version>
</dependency>
But: if this is happening is probably because you've a conflict between versions, so it's better if you find out why you are loading an older spring-data-commons
Often this happens when you have 2 dependencies in your maven pom.xml file with the same "groupId" but different versions.
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons-core -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons-core</artifactId>
<version>1.4.1.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.11.1.RELEASE</version>
</dependency>
Common "groupId"'s should have the same version number.