Results 1 to 10 of 10

Thread: spring data graph - persist undefined

  1. #1

    Default spring data graph - persist undefined

    I imported spring data graph examples in eclipse and i get the following error:
    The method persist() is undefined for the type ...

    Can anyone help me?
    Last edited by Ionut Daniel; May 6th, 2011 at 04:25 AM.

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Please install the AJDT plugin from:
    http://download.eclipse.org/tools/ajdt/36/dev/update

    Spring Data Graph uses AspectJ to add methods (like persist() ) to your domain objects.

    Then just rebuild the project and it should work.

    Maven should work anyway.

    Cheers

    Michael

  3. #3
    Join Date
    Dec 2010
    Posts
    3

    Default Eclipse problem with Spring Data Graphs Example - HelloWorlds

    I had a similar problem loading Helloworlds into Eclipse.

    I followed Michael's suggestions, loaded the AspectJ plugin to eclipse.

    I am still getting errors in the World class (see .png screen shot):
    spring data graph example error.jpg

    Is there some additional configuration I need to do on the AspectJ plugin or the project?

    FWIW, mvn clean package exec:java worked fine from the command line.

    sgg

  4. #4

    Default

    RIght click on the project -> configure -> convert to AspectJ Project

  5. #5
    Join Date
    Dec 2010
    Posts
    3

    Default The project was generated as an AspectJ project

    Mattias:
    Thanks for the reply. The project already is AspectJ, so that is not the concern.

    What I did was download the latest SpringToolSuite and loaded the project there. Although the editor still flagged various parts of the code with errors (ie the editor wasn't picking up the introductions generated by the annotations), at least the Junit tests ran and were modifiable).

    sgg

  6. #6
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    You still have to update STS to the lastest dev-version of AJDT as the AspectJ team fixed two errors that occur with SDG and the stock STS ships with the older, stable version of the AJDT addon.

    I tested it myself and it works fine.

    Tests and Maven/Build should not pose a problem those were just visual editor bugs.

    Cheers

    Michael

  7. #7
    Join Date
    Jul 2011
    Location
    Denmark
    Posts
    31

    Default

    I'm pretty new to aspects, and I have the same problem as above (2.0.0.M1): The method persist() is undefined

    I have STS 2.8.0 which I believe has the newest AJDT plugin.
    I configured it via maven as described here: http://static.springsource.org/sprin.../html/#d0e2399

    Anything the docs neglects to mention?

  8. #8
    Join Date
    Jan 2012
    Posts
    2

    Default

    I have STS 2.8.1 and still have this problem. Cleaning/building the project sometimes fixes it but then it comes back again seemingly randomly. Sadly I'm about to give up on Spring Data Graph if this doesn't get fixed properly soon. I tried out the Cineasts example already a few months ago and had the same problem so I'm running out of patience.

  9. #9
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    What version of SDN are you running now?

    Please use neo4jTemplate.save(entity) or repository.save(entity) instead. You don't have to use the Active-Record methods to interact with entities.

    Did you look into the AspectJ path / AspectJ-Configurator?


    You might also look into the simple mapping mode which doesn't require AspectJ. There is also an example for cineasts and hello-world using the simple mapping in http://spring.neo4j.org/examples

    Sorry for the IDE issues but those are really AspectJ-Plugin related and not inherently SDN's fault.

  10. #10
    Join Date
    Jan 2012
    Posts
    2

    Default

    Thanks for the tip. I'm using the 2.0.0.RELEASE of spring-data-neo4j.
    Made a quick test with repository.save(entity) and it worked fine. Will skip the Active-Record methods for now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •