Spring Data Neo4j
  1. Spring Data Neo4j
  2. DATAGRAPH-104

Spring Data Graph + Eclipse + AJDT : Editor errors

    Details

      Description

      a) In @RelatedToVia & @RelatedTo & @NodeEntity annotations, you get something like :
      Type mismatch : Cannot convert from Class<XXX> to Class<? extends RelationshipBacked>

      b) In relateTo(...) , getRelationshipTo(), persist() and all other introduced methods, you get a
      The method relateTo(World, String) is undefined for the type XXX
      or
      The method persist() is undefined for the type XXX
      etc

      c) Finally in repository definitions like
      [CODE]public interface XXXRepository extends GraphRepository<XXX>, NamedIndexRepository<XXX> {}[/CODE]
      you get:
      Bound mismatch: The type XXX is not a valid substitute for the bounded parameter <T
      extends GraphBacked<?>> of the type NamedIndexRepository<T>

      Bound mismatch: The type XXX is not a valid substitute for the bounded parameter <T
      extends GraphBacked<?>> of the type GraphRepository<T>

      Related, but closed issue https://jira.springsource.org/browse/DATAGRAPH-39

      1. Eclipse-versions.txt
        5 kB
        Agelos Pikoulas
      2. sdg-ajdt.patch
        39 kB
        Stefan Ollinger
      3. sdg-ajdt.patch
        39 kB
        Stefan Ollinger
      4. SDGerrors.txt
        9 kB
        Agelos Pikoulas
      1. Eclipse3.7.1-STS2.7.2-SDGErrors.png
        1.10 MB

        Activity

        Hide
        Andy Clement added a comment -

        Hi. I really need some code that shows the problem so I've just imported two projects you referenced:

        I imported those as 'existing maven projects'. I'm using a recent STS (2.8.0.M1) and just updated to the most recent AJDT (this is all eclipse 3.7).

        Which files show editor errors for you? I opened every source file in the project, and saw no editor problems.
        Currently, for hello-worlds, in the problems view I see 9 warnings. 7 'advice defined has not been applied' and 2 'import never used'.

        I tried the same thing with cineasts and same story. I do see one error against the jsp file, but nothing Aspect related.

        If you can tell me how you imported those test projects and which files show an error, maybe that'll help. Just to confirm terminology, I presume by 'editor errors' you mean errors that appear only in the editor and not at all in the problems view. If you imported them by doing an 'mvn eclipse:eclipse' before importing, that would be a problem.

        Show
        Andy Clement added a comment - Hi. I really need some code that shows the problem so I've just imported two projects you referenced: Spring Data Graph example: hello-worlds (from https://github.com/SpringSource/spri...graph-examples ) Cineast (from git://github.com/jexp/cineasts.git) I imported those as 'existing maven projects'. I'm using a recent STS (2.8.0.M1) and just updated to the most recent AJDT (this is all eclipse 3.7). Which files show editor errors for you? I opened every source file in the project, and saw no editor problems. Currently, for hello-worlds, in the problems view I see 9 warnings. 7 'advice defined has not been applied' and 2 'import never used'. I tried the same thing with cineasts and same story. I do see one error against the jsp file, but nothing Aspect related. If you can tell me how you imported those test projects and which files show an error, maybe that'll help. Just to confirm terminology, I presume by 'editor errors' you mean errors that appear only in the editor and not at all in the problems view. If you imported them by doing an 'mvn eclipse:eclipse' before importing, that would be a problem.
        Hide
        Stefan Ollinger added a comment -

        Hi,

        when I import spring-data-graph-examples/restaurant-social as maven project into Eclipse, I get lots of error messages. They are all relating to the aspects not being applied. For example those:

        Type mismatch: cannot convert from Class<Recommendation> to Class<? extends RelationshipBacked> in UserAccount.java
        Type mismatch: cannot convert from Class<Restaurant> to Class<? extends NodeBacked> in UserAccount.java
        Type mismatch: cannot convert from Class<UserAccount> to Class<? extends NodeBacked> in UserAccount.java
        

        When i run a "mvn eclipse:eclipse", the errors are gone. So that must change some project settings. I attached a diff, that shows the difference between the project after importing it into Eclipse and running the Maven Eclipse plugin.

        Show
        Stefan Ollinger added a comment - Hi, when I import spring-data-graph-examples/restaurant-social as maven project into Eclipse, I get lots of error messages. They are all relating to the aspects not being applied. For example those: Type mismatch: cannot convert from Class<Recommendation> to Class<? extends RelationshipBacked> in UserAccount.java Type mismatch: cannot convert from Class<Restaurant> to Class<? extends NodeBacked> in UserAccount.java Type mismatch: cannot convert from Class<UserAccount> to Class<? extends NodeBacked> in UserAccount.java When i run a "mvn eclipse:eclipse", the errors are gone. So that must change some project settings. I attached a diff, that shows the difference between the project after importing it into Eclipse and running the Maven Eclipse plugin.
        Hide
        Stefan Ollinger added a comment -

        Diff between: import to eclipse and mvn eclipse:eclipse

        Show
        Stefan Ollinger added a comment - Diff between: import to eclipse and mvn eclipse:eclipse
        Hide
        Stefan Ollinger added a comment -
        Show
        Stefan Ollinger added a comment - sdg-ajdt.patch
        Hide
        Stefan Ollinger added a comment -

        Note that there was no AspectJ builder in the original .project file.

        Also the classpath is no longer based on a org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER classpath container, but on absolute paths with additional annotations for the AspectJ builder.

          <classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-neo4j/1.2.0.BUILD-SNAPSHOT/spring-data-neo4j-1.2.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/data/spring-data-neo4j/1.2.0.BUILD-SNAPSHOT/spring-data-neo4j-1.2.0.BUILD-SNAPSHOT-sources.jar">
            <attributes>
              <attribute name="org.eclipse.ajdt.aspectpath" value="true"/>
            </attributes>
          </classpathentry>
        

        Both differences seem relevant to this issue.

        Show
        Stefan Ollinger added a comment - Note that there was no AspectJ builder in the original .project file. Also the classpath is no longer based on a org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER classpath container, but on absolute paths with additional annotations for the AspectJ builder. <classpathentry kind="var" path="M2_REPO/org/springframework/data/spring-data-neo4j/1.2.0.BUILD-SNAPSHOT/spring-data-neo4j-1.2.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/data/spring-data-neo4j/1.2.0.BUILD-SNAPSHOT/spring-data-neo4j-1.2.0.BUILD-SNAPSHOT-sources.jar"> <attributes> <attribute name="org.eclipse.ajdt.aspectpath" value="true"/> </attributes> </classpathentry> Both differences seem relevant to this issue.
        Hide
        Stefan Ollinger added a comment -

        My setup is as following:

        Eclipse 3.7 Classic (so no STS here)
        AJDT Version: 2.2.0.e37x-20110907-1500
        Maven m2e Plugin (no m2eclipse)

        Show
        Stefan Ollinger added a comment - My setup is as following: Eclipse 3.7 Classic (so no STS here) AJDT Version: 2.2.0.e37x-20110907-1500 Maven m2e Plugin (no m2eclipse)
        Hide
        Agelos Pikoulas added a comment -

        Reported errors on Cineasts

        Show
        Agelos Pikoulas added a comment - Reported errors on Cineasts
        Hide
        Agelos Pikoulas added a comment -

        Hi,

        The red X might not appear at first on the files when you open the project.
        Try a build and they will hesitantly but persistently show up.

        Going into one eg. Cineasts "Movie.java" you'll see the errors on all annotations @RelatedTo & @RelatedToVia. I 've attached SDGerrors.txt with all reported errors on Cineast.

        I imported the demos as a Git import (general project) and then enabled Maven Dependency on it.

        By "editor errors" I mean "IDE errors" - they do also appear on the "Problems" view as "Errors".

        Hope these help - let me know if there's anything else you want me to look.

        A'

        Show
        Agelos Pikoulas added a comment - Hi, The red X might not appear at first on the files when you open the project. Try a build and they will hesitantly but persistently show up. Going into one eg. Cineasts "Movie.java" you'll see the errors on all annotations @RelatedTo & @RelatedToVia. I 've attached SDGerrors.txt with all reported errors on Cineast. I imported the demos as a Git import (general project) and then enabled Maven Dependency on it. By "editor errors" I mean "IDE errors" - they do also appear on the "Problems" view as "Errors". Hope these help - let me know if there's anything else you want me to look. A'
        Hide
        Andy Clement added a comment -

        There are two kinds of error you can see with AJDT:

        • the temporary errors that appear only in the editor and have no entry in the problems view
        • permanent errors that appear in the editor and in the problems view

        The former kind of error appears if you have JDT weaving turned off (see the project preferences). If they still exist with that on, it is a bug we need to fix.

        The second kind of error can happen for two reasons: when the maven stuff fails to recognize that there are aspect libraries it should be using; or when the Javabuilder is being used instead of (or in addition to!) the ajbuilder.

        @Agelos

        When you say imported as via "Git import (general project)" - can you tell me exactly which menu options you are using? I have tried two routes:

        1) Simply cloning (command line) then importing an 'existing maven project' - that works reliably for me.

        2) Cloning then 'import existing project' (non maven). Because of the project structure this immediately turned on maven dependency management for me, and the project works.

        I didn't run mvn eclipse:eclipse in either case.

        In both cases I've played around with the project for a few minutes and am unable to cause any errors to appear.

        I'm not denying there are errors, I just need a reliable way to make them appear so we can fix them. All the errors in your SDGErrors.txt file are what would appear if the project forgot there was an aspect library (or, even worse, had forgotten to build with AspectJ and dropped back to using the Java builder).

        @Stefan

        Indeed, if the AspectJ builder isn't being used (the java builder is being used instead), the aspects wont be in operation, leading to all these issues. I don't particularly trust the .project/.classpath that come with the myrestaurant-social project as the ajbuilder is mentioned twice in the default variant. Rebuilding them from scratch (deleting them then running mvn eclipse:eclipse) still produces double entries for ajbuilder which suggests to me that the pom isn't correct.

        But fundamentally, we need a reliable set of steps to produce a broken project, I'm getting a bit confused about the various import/build options here. Can we distill it down to a consistent set of simple steps that show a broken project in eclipse? If using any eclipse maven support please include a version number.

        Show
        Andy Clement added a comment - There are two kinds of error you can see with AJDT: the temporary errors that appear only in the editor and have no entry in the problems view permanent errors that appear in the editor and in the problems view The former kind of error appears if you have JDT weaving turned off (see the project preferences). If they still exist with that on, it is a bug we need to fix. The second kind of error can happen for two reasons: when the maven stuff fails to recognize that there are aspect libraries it should be using; or when the Javabuilder is being used instead of (or in addition to!) the ajbuilder. @Agelos When you say imported as via "Git import (general project)" - can you tell me exactly which menu options you are using? I have tried two routes: 1) Simply cloning (command line) then importing an 'existing maven project' - that works reliably for me. 2) Cloning then 'import existing project' (non maven). Because of the project structure this immediately turned on maven dependency management for me, and the project works. I didn't run mvn eclipse:eclipse in either case. In both cases I've played around with the project for a few minutes and am unable to cause any errors to appear. I'm not denying there are errors, I just need a reliable way to make them appear so we can fix them. All the errors in your SDGErrors.txt file are what would appear if the project forgot there was an aspect library (or, even worse, had forgotten to build with AspectJ and dropped back to using the Java builder). @Stefan Indeed, if the AspectJ builder isn't being used (the java builder is being used instead), the aspects wont be in operation, leading to all these issues. I don't particularly trust the .project/.classpath that come with the myrestaurant-social project as the ajbuilder is mentioned twice in the default variant. Rebuilding them from scratch (deleting them then running mvn eclipse:eclipse) still produces double entries for ajbuilder which suggests to me that the pom isn't correct. But fundamentally, we need a reliable set of steps to produce a broken project, I'm getting a bit confused about the various import/build options here. Can we distill it down to a consistent set of simple steps that show a broken project in eclipse? If using any eclipse maven support please include a version number.
        Hide
        Agelos Pikoulas added a comment -

        Hi Andy, thanks for your insights

        I 've tried many options importing the project :
        a) Import->Git>Project from Git->
        Clone repository https://github.com/jexp/cineasts.git & select it
        Import as general project

        Right click->Configure->Convert to Maven Project <<Problems appear>>
        Right click->Configure->Convert to AspectJ Project (adds AspectJ Runtime library) <<Problems continue>>
        Right click->Spring Tools -> Add Spring Project Nature & Enable Spring Aspects Tooling <<Problems continue>>
        I am attaching the resulted .project

        b) Import->Maven->Existing Maven Projects
        Navigate to “cineasts” frfom previous step (where I have deleted the previously generated .project)

        At this point I get two errors
        “No marketplace entries found to handle aspectj-maven-plugin:1.2:compile in Eclipse. Please see Help for more information.”
        “No marketplace entries found to handle aspectj-maven-plugin:1.2:test-compile in Eclipse. Please see Help for more information.”
        I choose "resolve later" and continue.
        <<The problems appear >>
        Right click->Configure->Convert to AspectJ Project (adds AspectJ Runtime library) <<Problems continue>>
        Right click->Spring Tools -> Add Spring Project Nature & Enable Spring Aspects Tooling <<Problems continue>>
        I am attaching the resulted .project

        In both cases I get “permanent errors that appear in the editor and in the problems view”.
        I confirm

        Right now I am using Groovy-Eclipse M2E integration 1.0.0.201106101132, but on my previous installation I used M2Eclipse (Sonatype) 0.12

        I am attaching the versions of the spring/ajdt. In case you need anything else let me know.

        Show
        Agelos Pikoulas added a comment - Hi Andy, thanks for your insights I 've tried many options importing the project : a) Import->Git>Project from Git-> Clone repository https://github.com/jexp/cineasts.git & select it Import as general project Right click->Configure->Convert to Maven Project <<Problems appear>> Right click->Configure->Convert to AspectJ Project (adds AspectJ Runtime library) <<Problems continue>> Right click->Spring Tools -> Add Spring Project Nature & Enable Spring Aspects Tooling <<Problems continue>> I am attaching the resulted .project b) Import->Maven->Existing Maven Projects Navigate to “cineasts” frfom previous step (where I have deleted the previously generated .project) At this point I get two errors “No marketplace entries found to handle aspectj-maven-plugin:1.2:compile in Eclipse. Please see Help for more information.” “No marketplace entries found to handle aspectj-maven-plugin:1.2:test-compile in Eclipse. Please see Help for more information.” I choose "resolve later" and continue. <<The problems appear >> Right click->Configure->Convert to AspectJ Project (adds AspectJ Runtime library) <<Problems continue>> Right click->Spring Tools -> Add Spring Project Nature & Enable Spring Aspects Tooling <<Problems continue>> I am attaching the resulted .project In both cases I get “permanent errors that appear in the editor and in the problems view”. I confirm Right now I am using Groovy-Eclipse M2E integration 1.0.0.201106101132, but on my previous installation I used M2Eclipse (Sonatype) 0.12 I am attaching the versions of the spring/ajdt. In case you need anything else let me know.
        Hide
        Agelos Pikoulas added a comment -

        Files for 29/Sep comment

        Show
        Agelos Pikoulas added a comment - Files for 29/Sep comment
        Hide
        Andy Clement added a comment -

        Thanks for all that.

        I tried your first instructions:

        clone https://github.com/jexp/cineasts.git and import it as a general project.

        I then did RightClick>Configure>ConvertToMavenProject and it all built clean...

        Now I am using m2eclipse 1.0.100.20110804-1717 (dont know if that makes a difference). I also have a couple of configurators installed, including one for AJDT:
        "m2e connector for build-helper-maven-plugin" 0.14.0.201107260131
        "m2e connector for mavenarchiver pom properties" 0.14.0.201107260131
        "Maven Integration for AJDT" 0.13.0.201107281640

        At this point I could successfully run the tests - all 20 OK. I didn't need to convert it to an AspectJ project as it already had the nature. I also did an 'Add spring project nature' to see where that got me. All tests still passing. Then I compared my .project to yours.

        I have the following extra entries in my .project file:
        <buildCommand>
        <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
        <arguments>
        </arguments>
        </buildCommand>
        <buildCommand>
        <name>org.eclipse.wst.common.project.facet.core.builder</name>
        <arguments>
        </arguments>
        </buildCommand>
        <buildCommand>
        <name>org.eclipse.wst.validation.validationbuilder</name>
        <arguments>
        </arguments>
        </buildCommand>

        I have some additional natures too.

        but then I am using STS 2.8.0.M2 rather than a basic eclipse because it has all the maven stuff installed and ready to use out of the box. I also see you are on Eclipse 3.7.1, which I am not.

        I then decided to avoid m2e and see if that made a difference. I went to the project on disk, deleted .classpath/.project, then regenerated them with 'mvn eclipse:eclipse' then refreshed in eclipse to pick that up. The project was reduced to simply using the ajbuilder, but it built just fine. I think we kind of expected this.

        I then did your final variant, importing as existing maven project. That just worked too.

        Perhaps you should install the AJDT configurator into your eclipse?

        (or, you could try in an STS 2.8.0.M2, just to see if that makes a difference)

        Show
        Andy Clement added a comment - Thanks for all that. I tried your first instructions: clone https://github.com/jexp/cineasts.git and import it as a general project. I then did RightClick>Configure>ConvertToMavenProject and it all built clean... Now I am using m2eclipse 1.0.100.20110804-1717 (dont know if that makes a difference). I also have a couple of configurators installed, including one for AJDT: "m2e connector for build-helper-maven-plugin" 0.14.0.201107260131 "m2e connector for mavenarchiver pom properties" 0.14.0.201107260131 "Maven Integration for AJDT" 0.13.0.201107281640 At this point I could successfully run the tests - all 20 OK. I didn't need to convert it to an AspectJ project as it already had the nature. I also did an 'Add spring project nature' to see where that got me. All tests still passing. Then I compared my .project to yours. I have the following extra entries in my .project file: <buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> I have some additional natures too. but then I am using STS 2.8.0.M2 rather than a basic eclipse because it has all the maven stuff installed and ready to use out of the box. I also see you are on Eclipse 3.7.1, which I am not. I then decided to avoid m2e and see if that made a difference. I went to the project on disk, deleted .classpath/.project, then regenerated them with 'mvn eclipse:eclipse' then refreshed in eclipse to pick that up. The project was reduced to simply using the ajbuilder, but it built just fine. I think we kind of expected this. I then did your final variant, importing as existing maven project. That just worked too. Perhaps you should install the AJDT configurator into your eclipse? (or, you could try in an STS 2.8.0.M2, just to see if that makes a difference)
        Hide
        Agelos Pikoulas added a comment -

        If you could give me some insight on where to find and how to install these configurators
        "m2e connector for build-helper-maven-plugin" 0.14.0.201107260131
        "m2e connector for mavenarchiver pom properties" 0.14.0.201107260131
        "Maven Integration for AJDT" 0.13.0.201107281640

        and "m2eclipse 1.0.100.20110804-1717"

        I will give a try of STS 2.8.0.M2 (standalone I guess) - I hope its stable enough to make it into my main eclipse installation!

        Show
        Agelos Pikoulas added a comment - If you could give me some insight on where to find and how to install these configurators "m2e connector for build-helper-maven-plugin" 0.14.0.201107260131 "m2e connector for mavenarchiver pom properties" 0.14.0.201107260131 "Maven Integration for AJDT" 0.13.0.201107281640 and "m2eclipse 1.0.100.20110804-1717" I will give a try of STS 2.8.0.M2 (standalone I guess) - I hope its stable enough to make it into my main eclipse installation!
        Hide
        Andy Clement added a comment -

        I'd have to dig out the update site for those - the configurators all come preinstalled in STS so I haven't needed to manually install them. I'll have a look. I do know the AJDT one should be here: http://dist.springsource.org/release/AJDT/configurator

        I have been trying the above instructions on Eclipse 3.7.1. Here is what I did:

        fresh Eclipse 3.7.1, installed egit, ajdt, m2e. I imported the project from git as before and after converting to a maven project it was all errors. I then deleted the project. I then installed the AJDT configurator from above and repeated the import/convert. This time the project built clean. So you might just need the AJDT configurator from that update url.

        Show
        Andy Clement added a comment - I'd have to dig out the update site for those - the configurators all come preinstalled in STS so I haven't needed to manually install them. I'll have a look. I do know the AJDT one should be here: http://dist.springsource.org/release/AJDT/configurator I have been trying the above instructions on Eclipse 3.7.1. Here is what I did: fresh Eclipse 3.7.1, installed egit, ajdt, m2e. I imported the project from git as before and after converting to a maven project it was all errors. I then deleted the project. I then installed the AJDT configurator from above and repeated the import/convert. This time the project built clean. So you might just need the AJDT configurator from that update url.
        Hide
        Michael Hunger added a comment -

        Andy,

        could you quickly explain what the configurator does and why he has to be there? Then we could add this to the documentation about AspectJ tooling.

        Thanks

        Michael

        Show
        Michael Hunger added a comment - Andy, could you quickly explain what the configurator does and why he has to be there? Then we could add this to the documentation about AspectJ tooling. Thanks Michael
        Hide
        Andy Clement added a comment -

        The AJDT configurator is a 'plugin' for the maven eclipse support (m2e). It is responsible for interpreting the AspectJ specific settings in a maven pom (aspectj-maven-plugin section) and configuring the project based on them. For example it adds the AspectJ nature to these projects, and most importantly it adds the appropriate aspectpath/inpath flags to any classpath entries that are added to the project, if they are marked as aspectpath/inpath in the pom.

        The URL I showed above is our new version of the configurator that is compatible with m2eclipse v1.0

        Show
        Andy Clement added a comment - The AJDT configurator is a 'plugin' for the maven eclipse support (m2e). It is responsible for interpreting the AspectJ specific settings in a maven pom (aspectj-maven-plugin section) and configuring the project based on them. For example it adds the AspectJ nature to these projects, and most importantly it adds the appropriate aspectpath/inpath flags to any classpath entries that are added to the project, if they are marked as aspectpath/inpath in the pom. The URL I showed above is our new version of the configurator that is compatible with m2eclipse v1.0
        Hide
        Agelos Pikoulas added a comment -

        Same problems.

        I installed the AJDT configurator http://dist.springsource.org/release/AJDT/configurator, deleted and reimported the projects in both ways, same result.

        I am attaching a screenshot. Notice that the red mark is NOT shown on the files them selves on the explorer, but only inside the contents. Also notice that the aspects have been applied properly, and it compiles/tests OK.

        I tried to to install the remaining configurators from http://download.jboss.org/jbosstools/updates/m2eclipse-wtp but I got stuck (ugh!)

        Cannot complete the install because one or more required items could not be found.
        Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
        Missing requirement: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper 0.15.0.201109290002) requires 'bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)' but it could not be found
        Cannot satisfy dependency:
        From: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
        To: org.sonatype.m2e.buildhelper [0.15.0.201109290002]

        Show
        Agelos Pikoulas added a comment - Same problems. I installed the AJDT configurator http://dist.springsource.org/release/AJDT/configurator , deleted and reimported the projects in both ways, same result. I am attaching a screenshot. Notice that the red mark is NOT shown on the files them selves on the explorer, but only inside the contents. Also notice that the aspects have been applied properly, and it compiles/tests OK. I tried to to install the remaining configurators from http://download.jboss.org/jbosstools/updates/m2eclipse-wtp but I got stuck (ugh!) Cannot complete the install because one or more required items could not be found. Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002) Missing requirement: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper 0.15.0.201109290002) requires 'bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)' but it could not be found Cannot satisfy dependency: From: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002) To: org.sonatype.m2e.buildhelper [0.15.0.201109290002]
        Hide
        Agelos Pikoulas added a comment -

        The errors shown on SDG in Eclipse 3.6/3.7

        Show
        Agelos Pikoulas added a comment - The errors shown on SDG in Eclipse 3.6/3.7
        Hide
        Andy Clement added a comment -

        Not quite the same problem though, is it? We are getting closer (although it may not feel like it). Now you have no compilation problems (in the problems view). If you have errors in the editor and not in the problems view (which your screenshot seems to indicate) - then it is not a regular compilation problem, it is a reconciling problem, since the annotations in the editor gutter are added via a special reconciling compile that happens separately to the main build. All your paths are set correctly and the configurator has worked (i.e. you dont need those other configurators, I know I didn't).

        I opened the Movie type when I was checking my basic eclipse 3.7.1 and it was fine.

        There are two things to check:
        1) Please check that 'JDT weaving' is turned on in your eclipse preferences. It should be turned on by default when AJDT is installed but lets confirm that.
        2) Ensure your project is built. It looks to be built but just make sure by doing a full clean build of that project. The kinds of squiggle you are seeing rely on a clean build occurring so that AJDT knows all the relationships in the project and can avoid the squiggles. AspectJ does not persist build state across restarts of eclipse, so a project build is required when eclipse is restarted, this normally happens just when you start interacting with the project but if the first thing you did after launching eclipse was look into the Movie type, you may see these underlines because a build hasn't happened.

        Show
        Andy Clement added a comment - Not quite the same problem though, is it? We are getting closer (although it may not feel like it). Now you have no compilation problems (in the problems view). If you have errors in the editor and not in the problems view (which your screenshot seems to indicate) - then it is not a regular compilation problem, it is a reconciling problem, since the annotations in the editor gutter are added via a special reconciling compile that happens separately to the main build. All your paths are set correctly and the configurator has worked (i.e. you dont need those other configurators, I know I didn't). I opened the Movie type when I was checking my basic eclipse 3.7.1 and it was fine. There are two things to check: 1) Please check that 'JDT weaving' is turned on in your eclipse preferences. It should be turned on by default when AJDT is installed but lets confirm that. 2) Ensure your project is built. It looks to be built but just make sure by doing a full clean build of that project. The kinds of squiggle you are seeing rely on a clean build occurring so that AJDT knows all the relationships in the project and can avoid the squiggles. AspectJ does not persist build state across restarts of eclipse, so a project build is required when eclipse is restarted, this normally happens just when you start interacting with the project but if the first thing you did after launching eclipse was look into the Movie type, you may see these underlines because a build hasn't happened.
        Hide
        Agelos Pikoulas added a comment -

        Andy, thank you, both of your last two comments made the difference!

        JDT Weaving apparently WAS NOT turned on by default. Turning it on and doing a "project->clean" in eclipse made all the editor error marks disappear

        You're also right about having to do a "clean" each time you're starting eclipse, cause these fake errors do appear each time.

        Michael I guess you can sum it up on the documentation.
        1) Make sure Window->Preferences->JDT Weaving in turned ON.
        2) The build path "*/.aj" is NOT needed - I dont have it and it works fine.
        3) A clean is required each time eclipse starts

        Show
        Agelos Pikoulas added a comment - Andy, thank you, both of your last two comments made the difference! JDT Weaving apparently WAS NOT turned on by default. Turning it on and doing a "project->clean" in eclipse made all the editor error marks disappear You're also right about having to do a "clean" each time you're starting eclipse, cause these fake errors do appear each time. Michael I guess you can sum it up on the documentation. 1) Make sure Window->Preferences->JDT Weaving in turned ON. 2) The build path "* / .aj" is NOT needed - I dont have it and it works fine. 3) A clean is required each time eclipse starts
        Hide
        Andy Clement added a comment -

        Glad you are finally working, phew.

        On (3) it isn't quite that a clean is required, it is that a build is required. The first time you change a file in the project (even a whitespace change) the necessary build will occur, but cleaning the project is a quick way to force a build.

        I do wonder why JDT weaving got turned off though, hmmm.

        Show
        Andy Clement added a comment - Glad you are finally working, phew. On (3) it isn't quite that a clean is required, it is that a build is required. The first time you change a file in the project (even a whitespace change) the necessary build will occur, but cleaning the project is a quick way to force a build. I do wonder why JDT weaving got turned off though, hmmm.
        Hide
        Stefan Ollinger added a comment -

        Here is a list of steps to reproduce the behaviour:

        $ git clone https://github.com/SpringSource/spring-data-neo4j.git
        $ cd spring-data-neo4j
        $ mvn clean install

        Import spring-data-neo4j-examples/hello-worlds-aspects into eclipse

        Problem 1: Project is not converted to AspectJ Project -> Convert manually
        Problem 2: AspectJ does not weave aspects in -> add aspect .jar files manually to Inpath and Aspect Path

        .classpath looks now like this:

        <?xml version="1.0" encoding="UTF-8"?>
        <classpath>
        	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
        	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
        	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
        	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
        	<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
        	<classpathentry kind="lib" path="/home/ollinger/.m2/repository/org/springframework/spring-aspects/3.0.6.RELEASE/spring-aspects-3.0.6.RELEASE.jar">
        		<attributes>
        			<attribute name="org.eclipse.ajdt.inpath" value="org.eclipse.ajdt.inpath"/>
        			<attribute name="org.eclipse.ajdt.aspectpath" value="org.eclipse.ajdt.aspectpath"/>
        		</attributes>
        	</classpathentry>
        	<classpathentry kind="lib" path="/home/ollinger/.m2/repository/org/springframework/data/spring-data-neo4j-aspects/2.0.0.BUILD-SNAPSHOT/spring-data-neo4j-aspects-2.0.0.BUILD-SNAPSHOT.jar">
        		<attributes>
        			<attribute name="org.eclipse.ajdt.inpath" value="org.eclipse.ajdt.inpath"/>
        			<attribute name="org.eclipse.ajdt.aspectpath" value="org.eclipse.ajdt.aspectpath"/>
        		</attributes>
        	</classpathentry>
        	<classpathentry kind="output" path="target/classes"/>
        </classpath>
        

        Is it possible to automate that process?

        Regards,
        Stefan

        Show
        Stefan Ollinger added a comment - Here is a list of steps to reproduce the behaviour: $ git clone https://github.com/SpringSource/spring-data-neo4j.git $ cd spring-data-neo4j $ mvn clean install Import spring-data-neo4j-examples/hello-worlds-aspects into eclipse Problem 1: Project is not converted to AspectJ Project -> Convert manually Problem 2: AspectJ does not weave aspects in -> add aspect .jar files manually to Inpath and Aspect Path .classpath looks now like this: <?xml version= "1.0" encoding= "UTF-8" ?> <classpath> <classpathentry kind= "src" output= "target/classes" path= "src/main/java" /> <classpathentry excluding= "**" kind= "src" output= "target/classes" path= "src/main/resources" /> <classpathentry kind= "src" output= "target/test-classes" path= "src/test/java" /> <classpathentry kind= "con" path= "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" /> <classpathentry kind= "con" path= "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" /> <classpathentry kind= "con" path= "org.eclipse.ajdt.core.ASPECTJRT_CONTAINER" /> <classpathentry kind= "lib" path= "/home/ollinger/.m2/repository/org/springframework/spring-aspects/3.0.6.RELEASE/spring-aspects-3.0.6.RELEASE.jar" > <attributes> <attribute name= "org.eclipse.ajdt.inpath" value= "org.eclipse.ajdt.inpath" /> <attribute name= "org.eclipse.ajdt.aspectpath" value= "org.eclipse.ajdt.aspectpath" /> </attributes> </classpathentry> <classpathentry kind= "lib" path= "/home/ollinger/.m2/repository/org/springframework/data/spring-data-neo4j-aspects/2.0.0.BUILD-SNAPSHOT/spring-data-neo4j-aspects-2.0.0.BUILD-SNAPSHOT.jar" > <attributes> <attribute name= "org.eclipse.ajdt.inpath" value= "org.eclipse.ajdt.inpath" /> <attribute name= "org.eclipse.ajdt.aspectpath" value= "org.eclipse.ajdt.aspectpath" /> </attributes> </classpathentry> <classpathentry kind= "output" path= "target/classes" /> </classpath> Is it possible to automate that process? Regards, Stefan
        Hide
        Michael Hunger added a comment -

        Stefan, how did you import the project?

        I just tried it with STS 2.7.2 and STS 2.8.0 just "Import existing maven projects" from the current github repo of SDN, and it worked out of the box.

        Also just installed vanilla eclipse 3.6.2 and 3.7.1

        Then I added:
        to 3.6.2: http://download.eclipse.org/tools/ajdt/36/dev/update
        to 3.7.1: http://download.eclipse.org/tools/ajdt/37/dev/update

        to both: http://dist.springsource.org/release/AJDT/configurator (with m2e)

        In all 4 cases it imported w/o issues and I ran the unit tests after cleaning (and recompiling the project) in all IDE without any problems.
        All the Aspect Markers were also in place in the editors.

        HTH

        Cheers

        Michael

        Show
        Michael Hunger added a comment - Stefan, how did you import the project? I just tried it with STS 2.7.2 and STS 2.8.0 just "Import existing maven projects" from the current github repo of SDN, and it worked out of the box. Also just installed vanilla eclipse 3.6.2 and 3.7.1 Then I added: to 3.6.2: http://download.eclipse.org/tools/ajdt/36/dev/update to 3.7.1: http://download.eclipse.org/tools/ajdt/37/dev/update to both: http://dist.springsource.org/release/AJDT/configurator (with m2e) In all 4 cases it imported w/o issues and I ran the unit tests after cleaning (and recompiling the project) in all IDE without any problems. All the Aspect Markers were also in place in the editors. HTH Cheers Michael
        Hide
        Michael Hunger added a comment -

        Updated documentation with references to the Aspect-Configurator and the other Hints that came up.

        Show
        Michael Hunger added a comment - Updated documentation with references to the Aspect-Configurator and the other Hints that came up.
        Hide
        Stefan Ollinger added a comment -

        I imported the project with "Import existing maven projects". Tried today again on my development computer and it worked without any difficulty. I need to re-check on my home computer where the import failed.

        Thanks for your support so far.

        Show
        Stefan Ollinger added a comment - I imported the project with "Import existing maven projects". Tried today again on my development computer and it worked without any difficulty. I need to re-check on my home computer where the import failed. Thanks for your support so far.

          People

          • Assignee:
            Michael Hunger
            Reporter:
            Agelos Pikoulas
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: