-
May 6th, 2011, 04:21 AM
#1
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.
-
May 7th, 2011, 05:49 PM
#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
-
May 18th, 2011, 09:29 AM
#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):
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
-
May 19th, 2011, 01:59 AM
#4
RIght click on the project -> configure -> convert to AspectJ Project
-
May 19th, 2011, 06:21 AM
#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
-
May 20th, 2011, 02:47 AM
#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
-
Nov 8th, 2011, 03:56 PM
#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?
-
Jan 15th, 2012, 04:03 PM
#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.
-
Jan 15th, 2012, 07:04 PM
#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.
-
Jan 16th, 2012, 12:11 PM
#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.
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
-
Forum Rules