Announcement Announcement Module
Collapse
No announcement yet.
SDN 2.0.0 does not compile Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDN 2.0.0 does not compile

    Hello everyone

    I'm having trouble setting up the development environment for SDN 2.0.0.
    A maven build on the command line fails to compile:

    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\GraphDatabaseContext.java:[120,64] type parameters of <U>U cannot be determined; no unique maximal instance exists for type variable U with upper bounds T,java.lang.Object
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\GraphDatabaseContext.java:[129,36] type parameters of <S>S cannot be determined; no unique maximal instance exists for type variable S with upper bounds S,org.neo4j.graphdb.PropertyContainer
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\GraphDatabaseContext.java:[135,52] type parameters of <S>S cannot be determined; no unique maximal instance exists for type variable S with upper bounds S,org.neo4j.graphdb.PropertyContainer
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\query\CypherQueryEngine.java:[63,34] execute(org.neo4j.cypher.commands.Query) in org.neo4j.cypher.javacompat.ExecutionEngine cannot be applied to (org.neo4j.cypher.commands.Query,java.util.Map<jav a.lang.String,java.lang.Object>)
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \fieldaccess\IndexingPropertyFieldAccessorListener Factory.java:[119,67] type parameters of <S>S cannot be determined; no unique maximal instance exists for type variable S with upper bounds T,org.neo4j.graphdb.PropertyContainer
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\path\ConvertingEntityPath.java:[46,98] type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object
    [ERROR] \Users\james\Documents\Development\spring-data-neo4j\spring-data-neo4j\src\main\java\org\springframework\data\neo4j \support\path\ConvertingEntityPath.java:[71,70] type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object

    I found this answer on Stackoverflow that solves the problem. I had to add explicit casts to make the code compile. See the changes here.
    Can you compile the project with maven as it is? Otherwise I'd issue a pull request with these changes.


    There is another story in eclipse. There I have three compilation errors:

    The method execute(Query) in the type ExecutionEngine is not applicable for the arguments (Query, Map<String,Object>) CypherQueryEngine.java line 63
    This indeed is a problem since the execute Method of the org.neo4j.cypher.javacompat.ExecutionEngine class does not have a parameter argument (yet?). I updated the snapshots with mvn -U without any success.

    The method isWriteable() of type RestIndex<T> must override or implement a supertype method RestIndex.java line 97
    isWriteable is indeed not an overridden method. Hm.

    Type mismatch: cannot convert from Iterable<EntityPath<S,E>> to Iterable<EntityPath<Group,Person>> TraversalTest.java line 92
    I absolutely don't understand why this conversion should not be possible... :-(

    Just having a look at the first two erros makes me wonder why it compiles on maven...
    Any ideas ?

    Oh. And another issue.
    What Java code style formatter settings are you using in eclipse? Do you have a profile file that can be imported? This would be nice.


    Best regards,
    James

  • #2
    That is probably an issue of the eclipse compiler.

    It builds fine with javac/bamboo: https://build.springsource.org/brows...-DATAGRAPH-478

    I don't use eclipse - I have to get a new eclipse/sts installation to check this out. Probably you can fix that quicker than me and issue a pull request.

    Code style is java default style.

    Cheers

    Michael

    Comment


    • #3
      I was able to get it to compile via maven, but I had to disable unit testing (it fails on some of the REST tests, I assume because there's no target REST server to test against):

      mvn clean install -Dmaven.test.skip=true

      Comment


      • #4
        I just did:

        Code:
        > git clone [email protected]:SpringSource/spring-data-neo4j.git
        
        using mvn2
        > mvn clean install
        
        [INFO] ------------------------------------------------------------------------
        [INFO] Reactor Summary:
        [INFO] ------------------------------------------------------------------------
        [INFO] Spring Data Neo4j Parent .............................. SUCCESS [1.664s]
        [INFO] Spring Data Neo4j ..................................... SUCCESS [16.031s]
        [INFO] Spring Data Neo4J Aspects ............................. SUCCESS [13.554s]
        [INFO] Spring Data Neo4j REST Wrapper ........................ SUCCESS [27.176s]
        [INFO] Spring Data Neo4J Cross-Store Handling ................ SUCCESS [4.450s]
        [INFO] Spring Data Neo4j hello-worlds ........................ SUCCESS [4.338s]
        [INFO] imdb .................................................. SUCCESS [3.977s]
        [INFO] Movies ................................................ SUCCESS [8.201s]
        [INFO] myrestaurants-social .................................. SUCCESS [15.397s]
        [INFO] Spring Data Neo4j Distribution ........................ SUCCESS [15.138s]
        [INFO] ------------------------------------------------------------------------
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESSFUL
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 1 minute 50 seconds
        [INFO] Finished at: Fri Oct 07 20:09:54 CEST 2011
        [INFO] Final Memory: 97M/123M
        [INFO] ------------------------------------------------------------------------

        Comment


        • #5
          I kept getting compilation errors - whatever I tried. I had to delete my local maven repository.
          I now can compile SDN 2.0.0 with maven.

          In one test case I still have an error in eclipse, but I can live with tat for the moment...

          Comment


          • #6
            Really weird. Sometimes maven downloads error pages of mvn repositories and stores them as jar files, they are then broken and break your build.

            What is the error in eclipse?

            Comment


            • #7
              It's the error:
              Type mismatch: cannot convert from Iterable<EntityPath<S,E>> to Iterable<EntityPath<Group,Person>> TraversalTest.java line 92

              It's not that severe, but still very strange that it compiles with maven, but not within eclipse...

              Comment

              Working...
              X