1

Spent 2 days trying to understand how to enable Eclipse work with Spring Data Graph, have no idea yet. The code is like this:

@NodeEntity
public class Person {   
    public Person() {           
    }
}
...
public class App {
    public static void main(String[] args) {
        Person p = new Person().persist();
    }
}

This code is absolutely fine, when I build it with Maven. When I open the project in Eclipse, it says that there's no method persist() in class Person.

I'm using Eclipse 3.7 (on Ubuntu 11.04), Spring 3.0.6.BUILD-SNAPSHOT, AspectJ 1.6.12.BUILD-SNAPSHOT, Spring Data Graph 1.2.0.BUILD-SNAPSHOT. I also have AJDT 2.2.0.e37x-20110815-2000 installed.

My Eclipse project is AspectJ-enabled (I have AJ on project's icon).

I'm wondering if anyone could tell me what are the exact versions of all these tools I need to install in order to get rid of errors in Eclipse.

Please, comment if these details are not enough.

Update:

Also posted this question to official Spring Data Graph forums:

http://forum.springsource.org/showthread.php?113629-Using-Spring-Data-Graph-in-real

no feedback so far.

Andrey Agibalov
  • 7,624
  • 8
  • 66
  • 111

3 Answers3

2

It is used in real projects, no worries.

The problem you've encountered with the tooling is a sad part of the story. We didn't anticipate that many issues with AJ in eclipse with the AJDT plugin developed by the AspectJ guys.

There is a second thread in the forum and a JIRA issue, in which the AJDT project lead concluded the following:

  • Make sure the Project Properties -> AspectJ -> Aspect Paths are set correctly
  • Make sure Window->Preferences->JDT Weaving in turned ON.
  • The build path "*/.aj" is NOT needed - I dont have it and it works fine.
  • A project build is required each time eclipse starts
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
  • I've removed the post about "immaturity", everything works fine, managed to solve all my technical problems. It's hard, but not impossible. Thanks for the things you do, Michael! – Andrey Agibalov Oct 04 '11 at 14:06
1

Obsolete: See Michal Hunger's answer

I ran into the same problems, what did the trick for me was fixing the Java build path, as described here (the note) http://static.springsource.org/spring-data/data-graph/docs/current/reference/multi/programming-model.html

After that I had to clean and rebuild the project.

Hope that helps.

jotomo
  • 489
  • 4
  • 9
  • Thank's a lot for your answer. Gonna check it once again. – Andrey Agibalov Sep 08 '11 at 16:43
  • Could you spend 10 minutes for community and share minimal eclipse project on github? :-) – Andrey Agibalov Sep 08 '11 at 18:41
  • I just updated the hello-world example (which is a nice project template) to SDG 1.1.0 and put it on github. The eclipse specific files are next; I'll let you know when I've done that (I should get to it by tomorrow evening or earlier) – jotomo Sep 08 '11 at 19:37
  • 1
    Give this a try https://github.com/mockenh/spring-data-graph-examples ; the hello-world example is updated and turned into an eclipse project which is working well for me. Running on Ubuntu 10.4, with Eclipse Indigo and development snapshots of the AJDT tools (Update site: http://download.eclipse.org/tools/ajdt/37/dev/update/). – jotomo Sep 08 '11 at 21:14
  • P.S. I'm using m2e and only the POM of the hello-world example is updated - I didn't touch the gradle scripts and such – jotomo Sep 09 '11 at 07:07
1

From the AJDT website:

AJDT configurator for m2e v1.0 is now available at http://dist.springsource.org/release/AJDT/configurator/. Add this update site to your Eclipse install manager to install the configurator. This configurator will ensure that Maven projects in Eclipse are properly configured with AspectJ and AJDT. posted 09-30-11

I've installed the above and my AspectJ build path now has spring-aspects and spring-data-neo4j added, with the comment 'From: Maven Dependencies'. (As a side note: libs added to the AspectJ build path are also added to the Java build path).

However, I don't yet understand what the configurator does exactly or what is needed in the POM to 'activate' it, as the configurator properly adjusted (the AspectJ build path of) the cineasts project, but not my project based on the hello-world example. Can somebody shed some light on this?

Edit: Looks like the configuratior takes the aspectLibraries configuration option from the aspectj-maven-plugin (if found in the POM) and adds it to the aspectj build path of the project.

Looks like we're getting closer to a good integration :-)

(Sorry for posting another answer, not much option with my reputation atm).

jotomo
  • 489
  • 4
  • 9