Spring Data Neo4j
  1. Spring Data Neo4j
  2. DATAGRAPH-39

Type mismatch: cannot convert from Class<World> to Class<? extends NodeBacked>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.0 M1
    • Fix Version/s: 1.0 M1
    • Component/s: EXAMPLES
    • Labels:
      None
    • Environment:
      mac and window on eclipse

      Description

      Compile error on spring-data-neo4j-hello-worlds example.

      I see "Type mismatch: cannot convert from Class<World> to Class<? extends
      NodeBacked>" error on the line below, on both mac and windows using the latest version of eclipse. The test cases run fine though. Don't know if I need to do something on eclipse.

      @RelatedTo(type = "REACHABLE_BY_ROCKET", elementClass = World.class, direction = Direction.BOTH)
      private Set<World> reachableByRocket;

      myrestaurants-social
      --------------------
      I get the following error when I try to add a friend. ( I am using jetty:run goal to run the web app)

      Cannot create a circular reference to [Node[1]]
      org.springframework.data.graph.neo4j.fieldaccess.AbstractNodeRelationshipFieldAccessor.checkNoCircularReference(AbstractNodeRelationshipFieldAccessor.java:72)
      org.springframework.data.graph.neo4j.fieldaccess.OneToNRelationshipFieldAccessorFactory$OneToNRelationshipFieldAccessor.setValue(OneToNRelationshipFieldAccessorFactory.java:63)
      org.springframework.data.graph.neo4j.fieldaccess.OneToNRelationshipFieldAccessorFactory$OneToNRelationshipFieldAccessor.setValue(OneToNRelationshipFieldAccessorFactory.java:1)
      org.springframework.data.graph.neo4j.fieldaccess.ManagedFieldAccessorSet.update(ManagedFieldAccessorSet.java:61)
      org.springframework.data.graph.neo4j.fieldaccess.ManagedFieldAccessorSet.add(ManagedFieldAccessorSet.java:72)
      com.springone.myrestaurants.web.FriendController.create(FriendController.java:37)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:427)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:415)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:788)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
      org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
      org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
      org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
      org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
      org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
      org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
      org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

        Activity

        Hide
        Thomas Risberg added a comment -

        That Included path should be:

        **/*.aj

        looks like JIRA did a bit of formatting magic on the previous comment.

        Show
        Thomas Risberg added a comment - That Included path should be: **/*.aj looks like JIRA did a bit of formatting magic on the previous comment.
        Hide
        sura added a comment -

        I added the */.aj to the java build path, but seeing the same problem. I have attached the image http://i.imgur.com/R6xnb.png

        Files with aj extension does not exist on the target folder or the inside the target/spring-data-neo4j-hello-worlds-1.0-SNAPSHOT.jar file. I used mvn clean package to generate the jar file for hello-world project.

        Thanks

        Show
        sura added a comment - I added the * / .aj to the java build path, but seeing the same problem. I have attached the image http://i.imgur.com/R6xnb.png Files with aj extension does not exist on the target folder or the inside the target/spring-data-neo4j-hello-worlds-1.0-SNAPSHOT.jar file. I used mvn clean package to generate the jar file for hello-world project. Thanks
        Hide
        sura added a comment -

        I get the warning
        [WARNING] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]

        even when I compile the project with maven 2.2

        Thanks.

        Show
        sura added a comment - I get the warning [WARNING] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch] even when I compile the project with maven 2.2 Thanks.
        Hide
        sura added a comment -

        If I run mvn compile two times then on the second run the warning is gone.

        >mvn clean
        >mvn compile
        ... I see the warnings ..
        >mvn compile
        ... warning is gone

        Show
        sura added a comment - If I run mvn compile two times then on the second run the warning is gone. >mvn clean >mvn compile ... I see the warnings .. >mvn compile ... warning is gone
        Hide
        Thomas Risberg added a comment -

        I thought you had problems building the spring-data-graph project and that's when you need to modify the included path. Sorry for the confusion. I had no trouble importing the hello-world example as an existing Maven project. How old is your check-out - could you try with a recent check-out of the examples?

        I also see a bunch of warnings for aspects that aren't applied - that's not a problem and you can ignore those.

        -Thomas

        Show
        Thomas Risberg added a comment - I thought you had problems building the spring-data-graph project and that's when you need to modify the included path. Sorry for the confusion. I had no trouble importing the hello-world example as an existing Maven project. How old is your check-out - could you try with a recent check-out of the examples? I also see a bunch of warnings for aspects that aren't applied - that's not a problem and you can ignore those. -Thomas

          People

          • Assignee:
            Michael Hunger
            Reporter:
            sura
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: