Announcement Announcement Module
Collapse
No announcement yet.
Unabel to Autowire Neo4jOperations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unabel to Autowire Neo4jOperations

    Hi, I am new to Neo4j and would like to try it out using spring-data. I have a basic maven project and am following examples from here: https://github.com/SpringSource/spri...mples/cineasts

    The build fails trying to Autowire Neo4jOperations:

    @Autowired private Neo4jOperations template;

    Maven output:
    No matching bean of type [org.springframework.data.neo4j.template.Neo4jOpera tions] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Aut owired(required=true)}

    I have these dependencies in pom.xml relating to Neo4j:
    Code:
    <dependency>
    	<groupId>org.springframework.data</groupId>
    	<artifactId>spring-data-neo4j</artifactId>
    	<version>2.0.0.RC1</version>
    </dependency>
    <dependency>
    	<groupId>org.neo4j</groupId>
    	<artifactId>neo4j</artifactId>
    	<version>1.6.M02</version>
    </dependency>
    Not sure where to go from here. Any feedback greatly appreciated!

    Markus

  • #2
    OK, I think I figured this one out halfway. Something is missing in the bean definition XML.

    Comment


    • #3
      Ok, thanks for the information, is there something missing in the docs?

      Enjoy Spring Data Neo4j and please provide feedback when you run into things.

      Michael

      Comment


      • #4
        I was simply forgetting to include the bean definitions for neo4j. That is fixed but now I am getting this error message when running mvn:

        Code:
        Context initialization failed
        java.lang.NoClassDefFoundError: org/springframework/data/convert/TypeAliasAccessor
        I think I am missing a dependency but I can't figure out which one. Any idea?

        Thanks,
        Markus

        Comment


        • #5
          Did you put in a manual dependency on spring-data-commons? This class is from spring data commons, version 1.2.0.

          Cheers

          Michael

          Comment


          • #6
            Hi Wue,
            I am having the same issue that @Autowired fails. Can you please tell me what were you missing and what changes u made to resolve the error?

            Comment

            Working...
            X