7

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.

4
  • 2
    looks like you use incompatible versions. Please post the relevant part of your pom.xml or list the relevant libs (jars). Also please post the complete stacktrace, because it would show which libary trys to invoke the "not existing" method. Commented Mar 14, 2015 at 7:05
  • please find below entire stack trace Commented Mar 14, 2015 at 19:44
  • i am using spring-data-jpa-1.7.2.RELEASE.jar Commented Mar 14, 2015 at 19:45
  • Thats not the complete stacktrace. Commented Mar 15, 2015 at 13:19

3 Answers 3

8

It comes from this commit:

https://github.com/spring-projects/spring-data-commons/commit/6677612f8eac7a7ab67206a5709b6e94cc51028b

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

Sign up to request clarification or add additional context in comments.

1 Comment

In my project we were using solr so spring-data-solr was taking old version of spring-data-common. This answer should be marked as correct.
0

I was able to solve this error , earlier i was using spring-data-jpa.1.7.2.RELEASE.jar , now i switched on to spring-data-jpa.1.6.0.RELEASE.jar and it solved the problem

thanks for help.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.