Results 1 to 10 of 19

Thread: Spring Data Graph + Eclipse + AJDT : Editor errors

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    14

    Exclamation Spring Data Graph + Eclipse + AJDT : Editor errors

    Hi to all Graphistas,

    First of all I want to congratulate all the the developers of SDG - version 1.1 has added a lot of functionality, especially in terms of querying (Cypher, Gremlin etc).

    Now to the problem, Summary : Eclipse editor reports errors such as
    Type mismatch : Cannot convert from Class<XXX> to Class<? extends RelationshipBacked>
    or
    The method relateTo(World, String) is undefined for the type

    Its is an old problem that's been mentioned a lot

    http://forum.springsource.org/showth...sist-undefined
    http://forum.springsource.org/showth...-Graph-in-real & http://stackoverflow.com/questions/7...ph-and-eclipse
    http://forum.springsource.org/showthread.php?110204-Spring-Data-Graph-Example-(cineasts)-Related-blues-amp-how-to-run
    http://forum.springsource.org/showth...sing-RelatedTo
    http://forum.springsource.org/showth...h-with-eclipse
    http://forum.springsource.org/showth...ing-Data-graph


    Having spent the last couple of days trying every possible solution, I can assure you it has not been solved!

    I 've created a JIRA issue (https://jira.springsource.org/browse/DATAGRAPH-104) inahope that the appropriate springers can rectify it...

    To sum it up:

    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> {}

    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>

    Remedies (with no cure)
    a) The method with adding **/*.aj to the build path
    (mentioned in https://jira.springsource.org/browse/DATAGRAPH-39 and elsewhere including par 18.1.1 in http://static.springsource.org/sprin...ing-model.html)
    DOES NOT work.

    It seems that it does, cause once you add **/*.aj as the the build path inclusion, your *.java files are not included in your build path anymore!
    Therefore, ALL errors in those *.java files aren't reported & the editor functionality is hammered (no refactoring etc).
    Now, trying to also add **/*.java to the include build path, reveals that the problem persists):-(

    b) Updating Eclipse tools to the latest versions & configuring them is not verified to cure anything - check bellow :

    Configurations

    I have used various configurations that had the exact problem, my current is :
    - Eclipse 3.7 Indigo (
    Version: 3.7.0, Build id: I20110613-1736) on a Windows 2003 VM with 4GB RAM and the following plugin versions :
    AspectJ Development Tools 2.2.0.e37x-20110907-1500
    AspectJ Development Tools (AJDT) Source Code 2.2.0.e37x-20110907-1500
    Eclipse Weaving Service Feature 2.2.0.e37x-20110907-1500
    Equinox Weaving SDK 1.0.100.v20110502-79-F8PEVVFNNFsFV
    Maven Integration for Eclipse (Required) 0.12.1.20110112-1712
    Maven Integration for WTP (Optional) 0.12.0.20110421-1500
    Project configurators for commonly used maven plugins (temporary) 0.12.0.20101103-1500
    Spring IDE AJDT Integration (optional) 2.7.1.201107082359-RELEASE
    Spring IDE AOP Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Autowire Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Batch Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Core (required) 2.7.1.201107082359-RELEASE
    Spring IDE Integration, Flex and Web Services Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Mylyn Integration (optional) 2.7.1.201107082359-RELEASE
    Spring IDE OSGi Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Security Extension (optional) 2.7.1.201107082359-RELEASE
    Spring IDE Web Flow Extension (optional) 2.7.1.201107082359-RELEASE
    SpringSource Tool Suite (required) 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite dm Server Tools 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite Maven Support 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite Roo Support 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite tc Server Tools 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite Tutorials 2.7.1.201107091000-RELEASE
    SpringSource Tool Suite VMware Integration 2.7.1.201107091000-RELEASE



    My Maven (3.0.3) pom has the following versions :
    <spring.version>3.0.5.RELEASE</spring.version>
    <aspectj.version>1.6.12.M1</aspectj.version> (also tried M2)
    <slf4j.version>1.6.1</slf4j.version>
    <datastore-graph.version>1.1.0.RELEASE</datastore-graph.version> (same problems with SDG 1.0.0.RELEASE)

    Eclipse & Tools Configuration
    Tried various possible Eclipse / plugin settings:
    -
    Preferences -> JDT Weaving -> on & off (default) & reindexed
    - Preferences -> AspectJ Compiler
    -> Incremental Compiler Optimizations on & off(default)
    - Preferences -> Spring (used defaults)

    Projects compile & run
    I've verified the same exists problem on at least

    - Spring Data Graph examples like hello-worlds (https://github.com/SpringSource/spri...graph-examples)
    - Cineast (
    git://github.com/jexp/cineasts.git)

    and my own apps.
    Important : these apps compile fine with eclipse build and maven test. They also run fine.
    But there are the following Spring related warnings [WARNING] this affected type is not exposed to the weaver: org.neo4j.cineasts.domain.Person [Xlint:typeNotExposedToWeaver]
    [WARNING] this affected type is not exposed to the weaver: org.neo4j.cineasts.domain.Movie [Xlint:typeNotExposedToWeaver]
    [WARNING] this affected type is not exposed to the weaver: org.neo4j.cineasts.domain.Role [Xlint:typeNotExposedToWeaver]
    [WARNING] this affected type is not exposed to the weaver: org.neo4j.cineasts.domain.User [Xlint:typeNotExposedToWeaver]
    [WARNING] this affected type is not exposed to the weaver: org.neo4j.cineasts.domain.Rating [Xlint:typeNotExposedToWeaver]

    [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.data.neo4j.support.node.Neo4jN odeBacking has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.data.neo4j.support.node.Neo4jN odeBacking has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.data.neo4j.support.node.Neo4jN odeBacking 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.neo4j.support.relationshi p.Neo4jRelationshipBacking has not been applied [Xlint:adviceDidNotMatch]
    [WARNING] advice defined in org.springframework.data.neo4j.support.relationshi p.Neo4jRelationshipBacking has not been applied [Xlint:adviceDidNotMatch]
    Last edited by anodynos; Sep 14th, 2011 at 01:54 PM.

  2. #2

    Default

    Hi,

    you could try my test project: https://github.com/dozed/neo4j-test
    There are instructions on how to import it in eclipse.

    Here my setup:
    Eclipse Version: 3.7.0 Build id: I20110613-1736
    AJDT 2.2.0.e37x-20110907-1500
    M2E - Maven Integration for Eclipse

    Regards,
    Stefan

  3. #3
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Sorry for all that fuss and thanks for your efforts so far. I'm very sad about those repeated issues.

    I forwarded your problems to Andy Clement the AJ project lead. He certainly has more insights in that than any of us

    Cheers

    Michael

  4. #4
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    I tried that test project and I end up with some compile errors from just running "mvn clean test".

    Seeing a few errors like this
    ajdt-tests/neo4j-test/src/main/java/org/noorg/fink/neo4j/test/entities/Page.java:[14,31] incompatible types
    [ERROR] found : java.lang.Class<org.noorg.fink.neo4j.test.entities .Page>
    [ERROR] required: java.lang.Class<? extends org.springframework.data.neo4j.core.NodeBacked>
    Do you get a clean compile?

    Also, saw the note where you run "mvn eclipse:eclipse". I don't recommend that since the eclipse plugin isn't fully compatible with m2eclipse that is used in STS. Just import maven project from STS.

    -Thomas
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  5. #5
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Andy Clement commented at your JIRA issue.

    Hope that helps.

    Michael

  6. #6
    Join Date
    Jun 2011
    Posts
    14

    Default

    Same here - I imported https://github.com/dozed/neo4j-test and followed Stefan's instructions : eclipse errors persist.
    Also it doesn't build with "mvn test". It gives the same naive errors like :

    Code:
    ERROR \GITHome\git\neo4j-test\src\main\java\org\noorg\fink\neo4j\test\entities
    \Page.java:[14,31] incompatible types
    found   : java.lang.Class<org.noorg.fink.neo4j.test.entities.Page>
    required: java.lang.Class<? extends org.springframework.data.neo4j.core.NodeBack
    ed>

  7. #7

    Default

    Try the following:

    % mvn -DskipTests clean aspectj:compile compile package

    Seems that the AspectJ Maven plugin doesnt get active. (The tests are supposed to fail atm.)

    trisberg: for eclipse:eclipse, see my comments and the diff on the JIRA issue.
    Last edited by StefanOllinger; Sep 16th, 2011 at 06:07 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •