Announcement Announcement Module
Collapse
No announcement yet.
spring data graph - persist undefined Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:
    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

    Comment


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

      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
      Attached Files

      Comment


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

        Comment


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

          Comment


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

            Cheers

            Michael

            Comment


            • #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: http://static.springsource.org/sprin.../html/#d0e2399

              Anything the docs neglects to mention?

              Comment


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

                Comment


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

                  Comment


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

                    Comment

                    Working...
                    X