Announcement Announcement Module
Collapse
No announcement yet.
Compiler Error with hello world example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compiler Error with hello world example

    neo4j newbie question,

    I downloaded spring-data-graph-1.0.0.RC1 and started walking through the docs (very good by the way).


    As per the docs for RC1,

    1) pulled the example code from github.

    2) imported the hello world project into sts 2.6.0 as an existing maven project.

    3) project clean

    Note: there is an aspectj internal compiler error in the test case, but that may clear up when this issues is resolved.

    ---------------------------- console ------------------------------

    4/8/11 1:21:59 AM EDT: [ERROR] COMPILATION ERROR :
    4/8/11 1:21:59 AM EDT: [INFO] -------------------------------------------------------------
    4/8/11 1:21:59 AM EDT: [ERROR] \workdir\xps4\neo4j\spring-data-graph-examples\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java:[26,65] incompatible types
    found : java.lang.Class<org.springframework.data.neo4j.exa mples.hellograph.World>
    required: java.lang.Class<? extends org.springframework.data.graph.core.NodeBacked>

    4/8/11 1:21:59 AM EDT: [ERROR] \workdir\xps4\neo4j\spring-data-graph-examples\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java:[57,8] cannot find symbol
    symbol : method relateTo(org.springframework.data.neo4j.examples.h ellograph.World,java.lang.String)
    location: class org.springframework.data.neo4j.examples.hellograph .World

    4/8/11 12:57:53 AM EDT: Refreshing [/movies/pom.xml]


    This is my first pass through spring and neo4j, any pointers

  • #2
    Sorry for the problem. What version of maven does 2.6.0 come with?

    We'll check the issue and will report back to you.

    Thanks Michael

    Comment


    • #3
      Just downloaded a fresh STS 2.6.0 and cloned a fresh version of spring-data-graph examples. Imported the helloworld as an existing maven project and ran clean and after that the tests. No problems at all.

      Can you try to right click the pom ad choose Maven -> run maven test.

      It is rather the other way round - the aspectj compiler error keeps the necessary aspects from being applied causing the errors.
      Can you provide the AJ compiler error log file?

      Thanks
      Michael

      Comment


      • #4
        Michael,


        I will download a fresh sts 2.6.0 and try that. It has ridden through quite a few updates since a fresh install.


        Below is the output from clicking on pom, run as maven test. Tests driven through maven seems to compile and run ok.

        Under eclipse, There is an error on the package statement of WorldCounterTest.

        Under the problems tab, It say "internal compler error" on WorldCounterTest.

        I clicked on project->clean to trigger a full compile, and this also triggered the aspect j internal error when compiling.

        I will try again when the full sts 2.6.0 is download and installed.

        I am running on windows 7 64 bit, with the 64 bit version of sts.

        Hopefully a fresh sts will clear the issue.

        In summary:
        - all seems to be well when running test under sts when running as run -> maven test.
        - when compiling under sts, there is an aspect internal compiler error

        Thank you very much looking into this. I will post an update after the fresh sts 2.6.0 i down and running.

        Thanks
        Michael

        Note, I am breaking this into 2 messages. (one was too long)

        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] Building Spring Data Neo4j hello-worlds
        [INFO] task-segment: [test]
        [INFO] ------------------------------------------------------------------------
        [INFO] snapshot org.springframework.data:spring-data-neo4j:1.0.0.BUILD-SNAPSHOT: checking for updates from neo4j-public-repository
        [INFO] snapshot org.springframework.data:spring-data-graph-parent:1.0.0.BUILD-SNAPSHOT: checking for updates from neo4j-public-repository
        [INFO] snapshot org.springframework.data:spring-data-commons-core:1.0.0.BUILD-SNAPSHOT: checking for updates from neo4j-public-repository
        [INFO] snapshot org.springframework.data:spring-data-commons-parent:1.0.0.BUILD-SNAPSHOT: checking for updates from neo4j-public-repository
        [INFO] snapshot org.springframework.data:spring-data-graph-core:1.0.0.BUILD-SNAPSHOT: checking for updates from neo4j-public-repository
        [INFO] [aspectj:compile {execution: default}]
        [WARNING] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTr anslatorAspect has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.scheduling.aspectj.AbstractAsy ncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDriv enStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethod MockingControl has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethod MockingControl has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.data.graph.neo4j.support.relat ionship.Neo4jRelationshipBacking has not been applied [Xlint:adviceDidNotMatch]
        [WARNING] advice defined in org.springframework.data.graph.neo4j.support.relat ionship.Neo4jRelationshipBacking has not been applied [Xlint:adviceDidNotMatch]
        [INFO] [resources:resources {execution: default-resources}]
        [INFO] Using 'UTF-8' encoding to copy filtered resources.
        [INFO] Copying 2 resources
        [INFO] [compiler:compile {execution: default-compile}]
        [INFO] Nothing to compile - all classes are up to date
        [INFO] [aspectj:test-compile {execution: default}]
        [INFO] [resources:testResources {execution: default-testResources}]
        [INFO] Using 'UTF-8' encoding to copy filtered resources.
        [INFO] skip non existing resourceDirectory D:\workdir\xps4\neo4j\spring-data-graph-examples\hello-worlds\src\test\resources
        [INFO] [compiler:testCompile {execution: default-testCompile}]
        [INFO] Compiling 3 source files to D:\workdir\xps4\neo4j\spring-data-graph-examples\hello-worlds\target\test-classes
        [INFO] [surefire:test {execution: default-test}]
        [INFO] Surefire report directory: D:\workdir\xps4\neo4j\spring-data-graph-examples\hello-worlds\target\surefire-reports

        -------------------------------------------------------
        T E S T S
        -------------------------------------------------------
        Running org.springframework.data.neo4j.examples.hellograph .WorldCounterTest
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.068 sec
        Running org.springframework.data.neo4j.examples.hellograph .WorldRepositoryTest
        Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.391 sec
        Running org.springframework.data.neo4j.examples.hellograph .WorldTest
        Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 sec

        Results :

        Tests run: 11, Failures: 0, Errors: 0, Skipped: 0

        Comment


        • #5
          Post 3 --------- stack for aspectj internal compiler error (from sts, not maven-> maven test)

          java.lang.IllegalStateException
          at org.aspectj.weaver.TypeVariable.canBeBoundTo(TypeV ariable.java:175)
          at org.aspectj.weaver.ReferenceType.isAssignableFrom( ReferenceType.java:496)
          at org.aspectj.weaver.ReferenceType.isAssignableFrom( ReferenceType.java:399)
          at org.aspectj.weaver.ResolvedType.checkLegalOverride (ResolvedType.java:1999)
          at org.aspectj.weaver.ResolvedType.clashesWithExistin gMember(ResolvedType.java:1843)
          at org.aspectj.weav ... clipse.core.internal.jobs.Worker.run(Worker.java:5 4)

          Compile error: IllegalStateException thrown: Can't answer binding questions prior to resolving

          Comment


          • #6
            I download and installed a fresh version of STS.


            All maven driven builds run fine, I am still getting errors from STS eclipse build.

            I can work with maven for now. Will post followups.

            Thank you,
            Mike

            Comment


            • #7
              Hi Mike,

              I'm trying to investigate this (I'm the AspectJ project lead) but am having trouble recreating the failure. I've setup an STS 2.6.0 on a Win7 64bit, imported the hello-world sample as an existing maven project.

              I'm thinking it might relate to compile ordering. If you have time, could you try collecting a bit of info for me? First, open the 'AJDT Event trace view' (Window>ShowView>AJDTEventTrace) then in the window that appears click the arrows icon and select 'Compiler/task list messages'. Now when you full build (project clean), you will get diagnostics in the event trace view, kind of like this:

              12:5:44 Pipelining compilation
              12:5:44 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\App.java
              12:5:44 Timer event: 437ms: Time to first compiled message
              12:5:44 weaver operating in reweavable mode. Need to verify any required types exist.
              12:5:44 woven class org.springframework.data.neo4j.examples.hellograph .App (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\App.java)
              12:5:44 Timer event: 453ms: Time to first woven message
              12:5:44 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepositoryImpl.java
              12:5:44 woven class org.springframework.data.neo4j.examples.hellograph .WorldRepositoryImpl (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepositoryImpl.java)
              12:5:44 compiling C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepositoryTest.java
              12:5:44 woven class org.springframework.data.neo4j.examples.hellograph .WorldRepositoryTest (from C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepositoryTest.java)
              12:5:44 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\RelationshipTypes.java
              12:5:44 woven class org.springframework.data.neo4j.examples.hellograph .RelationshipTypes (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\RelationshipTypes.java)
              12:5:44 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .World (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java)
              12:5:45 addSourcelineTask message=The import org.springframework.data.graph.annotation.GraphPro perty is never used file=C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java line=3
              12:5:45 addSourcelineTask message=The import org.springframework.data.graph.core.NodeBacked is never used file=C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\World.java line=7
              12:5:45 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldCounter.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .WorldCounter (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldCounter.java)
              12:5:45 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\MyWorldRepository.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .MyWorldRepository (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\MyWorldRepository.java)
              12:5:45 compiling C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldTest.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .WorldTest (from C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldTest.java)
              12:5:45 compiling C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepository.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .WorldRepository (from C:\temp\hello-worlds\src\main\java\org\springframework\data\neo4 j\examples\hellograph\WorldRepository.java)
              12:5:45 compiling C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldCounterTest.java
              12:5:45 woven class org.springframework.data.neo4j.examples.hellograph .WorldCounterTest (from C:\temp\hello-worlds\src\test\java\org\springframework\data\neo4 j\examples\hellograph\WorldCounterTest.java)
              That shows me that my compile ordering was:

              App
              WorldRepositoryImpl
              WorldRepositoryTest
              ReliationshipTypes
              World
              WorldCounter
              MyWorldRepository
              WorldTest
              WorldRepository
              WorldCounterTest

              I'm interested in whether yours varies from that.

              Something else you can try is also turning off pipeline compilation. In the project properties, AspectJ section, enable project specific settings, then scroll all the way down and in Non-standard compiler options add
              HTML Code:
              -Xset:pipelineCompilation=false
              cheers
              Andy
              ---
              Andy Clement

              Comment


              • #8
                Andy,

                I followed Michael's path and downloaded a fresh 1.6.0 STS and that cleared the problem I wash having.

                I have been updating my sts for quite awhile, so the clean install was not out of line.

                I am not able to reproduce the orig problem in the clean install.

                Thanks,
                Mike

                Comment

                Working...
                X