我通过测试获得以下异常:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.repository.support.GraphRepositoryFactoryBean]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.data.neo4j.repository.support.GraphRepositoryFactoryBean.<init>()
强制更新依赖项。
SDN版本:4.0.0.BUILD-SNAPSHOT
Neo4j版本:2.2.5(与2.2.4相同的错误)
OGM:1.1.2-SNAPSHOT
...
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm</artifactId>
<version>1.1.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.BUILD-SNAPSHOT</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm</artifactId>
<version>1.1.2-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.test</groupId>
<artifactId>neo4j-harness</artifactId>
<version>2.2.5</version>
<scope>test</scope>
</dependency>
这只发生在测试中。
依赖关系或配置是否有任何变化?
感谢。
答案 0 :(得分:1)
对于遇到此问题的其他人,请确保您的@ComponentScan
不包含域和存储库包。