Announcement Announcement Module
No announcement yet.
spring data graph - persist undefined Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:25 AM.

  • #2
    Please install the AJDT plugin from:

    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.




    • #3
      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):

      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.

      Attached Files


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


        • #5
          The project was generated as an AspectJ project

          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).



          • #6
            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.




            • #7
              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:

              Anything the docs neglects to mention?


              • #8
                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
                  What version of SDN are you running now?

                  Please use or 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

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


                  • #10
                    Thanks for the tip. I'm using the 2.0.0.RELEASE of spring-data-neo4j.
                    Made a quick test with and it worked fine. Will skip the Active-Record methods for now.