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 -

        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: