Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Graph Example (cineasts) @Related blues & how to run Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Graph Example (cineasts) @Related blues & how to run

    Hi to all

    I was looking at the github cineasts example and it looks great, excellent example, thanks guys!

    I have two issues and I would appreciate any help.

    1) Unfortunately I am having some problems with it in Eclipse Helios.

    Eclipse complains for all @RelatedTo & @RelatedToVia annotations, whenever elementClass is present :

    Type mismatch : Cannot convert from Class<Role> to Class<? extends RelationshipBacked>


    eg in
    Code:
      
    
    @NodeEntity
    public class Movie {
    .......
          // error "Cannot convert from Class<Role> to Class<? extends RelationshipBacked>" here...
         @RelatedTo(elementClass = Person.class, type = "ACTS_IN", direction = INCOMING)
        Set<Person> actors;
    
        @RelatedToVia(elementClass = Role.class, type = "ACTS_IN",
    direction = INCOMING)
        Iterable<Role> roles;
    ....
    }
    The strange thing is that the project builds the .class files and the tests run OK.

    I am sensing something is cooked up in the latest commit or the pom.xml - could you please help somehow ?

    2) Can someone highlight step-by-step how we can execute cineasts @localhost ?
    There is not war/jar produced on build, is this OK or due to 1) above ?

    Regards

  • #2
    Please install the latest AJDT addon from: http://download.eclipse.org/tools/ajdt/36/dev/update

    There was a visualization error in the latest release. The new AJ milestone will be released next week.

    Please rebuild your project and then the visual errors should go away.

    You run cineasts with:

    mvn jetty:run
    and then do (once)
    http://localhost:8080/populate

    It creates some movies and two users (one admin) see the DatabasePopulator class.

    after that you can log in as the admin user (see username, password there) and use

    http://localhost:8080/admin/import/1-100

    to import the first 100 movies from themoviedb.org

    Cheers

    Michael

    Comment


    • #3
      Michael thanks a lot!

      Actually it was the 2.1.3 version of AJDT that was causing the problem on Eclipse 3.6 (maybe it works on 3.7)

      Uninstalling version 2.1.3 given on http://download.eclipse.org/tools/ajdt/36/dev/update
      and installing ver 2.1.2 from http://download.eclipse.org/tools/ajdt/36/update fixed the issue!

      Thanks for the running tips also, all went smooth (perhaps too smooth : took 601 secs, which I hope was due to jason net grabbing, not neo4j)!

      Comment


      • #4
        Sure, just run the same import a second time then you see that's just the json grabbing

        Cool that it worked out, have fun.

        Michael

        Comment


        • #5
          Well,

          I.was.wrong();
          problem.persists() ;

          All efforts with ver 2.1.2 or 2.1.3 went bust...

          Will have to learn to live with it until some solution with AJDT is found....

          Thanks Michael!

          Comment


          • #6
            Michael hi,

            Have you got any idea about this issue ? (I also see it replicated here http://forum.springsource.org/showth...sing-RelatedTo)

            It still persists (at all examples Cineasts, helloworlds etc),
            both in Eclipse 3.6 & 3.7 using the latest Spring plugins :

            AspectJ Development Tools 2.2.0.e37x-20110711-1300
            Spring IDE/SpringSource Tool Suite 2.7.1,
            Maven Integration for Eclipse (Required) 0.12.1.20110112-1712

            Apart from,
            Type mismatch : Cannot convert from Class<Role> to Class<? extends RelationshipBacked>
            in all @RelatedToVia & @RelatedTo annotations,

            I also get

            The method relateTo(World, String) is undefined for the type World
            on all relateTo calls like

            public void addRocketRouteTo( World otherWorld )
            {
            relateTo( otherWorld, RelationshipTypes.REACHABLE_BY_ROCKET );
            }
            and

            - Bound mismatch: The type World is not a valid substitute for the bounded parameter <T
            extends GraphBacked<?>> of the type NamedIndexRepository<T>
            - Bound mismatch: The type World is not a valid substitute for the bounded parameter <T
            extends GraphBacked<?>> of the type GraphRepository<T>
            on all repository definitions like
            public interface WorldRepository extends MyWorldRepository, GraphRepository<World>, NamedIndexRepository<World> {}

            Comment


            • #7
              Ok, problem solved.

              The answer is from https://jira.springsource.org/browse/DATAGRAPH-39

              Thomas Risberg added a comment - 21/Mar/11 9:00 AM

              Try editing the build path to include **/*.aj for the spring-data-neo4j project

              You can do this by selecting "Build Path -> Configure Build Path ..." from the Package Explorer

              Then for the spring-data-neo4j/src/main/java add "**/*.aj" to the Included path

              This fixed the problems for me. Looks like the m2eclipse plugin is not adding these sources automatically even though it's setting things up for AspectJ in other ways.
              A silly yet annoying problem...!

              Comment


              • #8
                Agreed,

                we'll look into easing this pain.

                Michael

                Comment

                Working...
                X