0

Hi i have downloaded one sample code for spring data neo4j. i am facing the below error can someone help on this.

Code snippet:

public interface PersonRepository extends GraphRepository<Person> {
    Person findByName(String name);
    Iterable<Person> findByTeammatesName(String name);
}

Application.java

PersonRepository personRepository = ctx.getBean(PersonRepository.class);
GraphDatabase graphDatabase = ctx.getBean(GraphDatabase.class);

Transaction tx = graphDatabase.beginTx();
try {
    personRepository.save(greg);
    personRepository.save(roy);
    personRepository.save(craig);

    greg = personRepository.findByName("Greg");

    //......

    for (String name: new String[]{greg.name, roy.name, craig.name}) {
            System.out.println(personRepository.findByName(name));

Error :

The return types are incompatible for the inherited methods PagingAndSortingRepository<Person,Long>.findAll(Sort), CRUDRepository<Person>.findAll(Sort) PersonRepository.java   /SpringDataForNeo4j/src line 5  Java Problem
The return types are incompatible for the inherited methods Repository<Person,Long>.count(), CRUDRepository<Person>.count() PersonRepository.java   /SpringDataForNeo4j/src line 5  Java Problem
The return types are incompatible for the inherited methods Repository<Person,Long>.findAll(), CRUDRepository<Person>.findAll() PersonRepository.java   /SpringDataForNeo4j/src line 5  Java Problem

Can someone help me to resolve this please.

jjaderberg
  • 9,844
  • 34
  • 34
naveena
  • 33
  • 1
  • 1
  • 5
  • According to the 'error message' your repository is inheriting methods with conflicting return types. 1) When do you get the error? (When compiling?) 2) What is on line 5 in your PersonRepository.java? 3) Where did you get the code? What do you mean by 'one sample code' and which version of SDN are you running? – jjaderberg Oct 07 '13 at 13:08

1 Answers1

0

I resolved this exact problem by updating these jars: (spring-data-commons and spring-data-commons-core ) to their latest version. In any case i think this is a library problem . Go to http://mvnrepository.com/artifact/org.springframework.data to get the latest jars.

yeaaaahhhh..hamf hamf
  • 746
  • 2
  • 13
  • 34