javaspring-bootspring-data-commons

Exception while using spring data commons for Page.map method


I am getting below exception on executing jar :

Exception in thread "main" java.lang.NoSuchMethodError:org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.<init>

(Lorg/springframework/core/type/AnnotationMetadata;Ljava/lang/Class;Lorg/springframework/core/io/ResourceLoader;Lorg/springframework/core/env/Environment;)V

I have added the following dependency in pom.xml :

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>1.13.10.RELEASE</version>
</dependency>

with parent as :

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.3.RELEASE</version>
</parent>

Solution

  • Working fine when added dependency after hours of hit and trial :

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>1.10.0.RELEASE</version>
        </dependency>