我可以专门回答SDN 4(4.0.0.RC1) - 它肯定适用于Neo4j 2.2
不支持XML配置,因此您需要使用基于Java的配置。看到 http://docs.spring.io/spring-data/neo4j/docs/4.0.0.RC1/reference/html/#reference_setup
也是一个简短的指南 https://www.airpair.com/neo4j/posts/the-essence-of-spring-data-neo4j-4
和示例应用程序 https://github.com/neo4j-examples?query=sdn4
让SDN与新的Neo4j一起工作时我也遇到了一些问题: 无法配置@Transaction以使用Spring Data Neo4j
(顺便说一句。有一个适用于我的Java配置,也许在从XML迁移到Java时尝试一下......)
它可能也是由neo4j-kernel jar中缺少的类引起的......在调试和调查源代码后管理找到一个解决方法,但也许现在最好的想法是降级neo4j版本...
尝试使用此Java配置文件而不是XML配置。
import org.neo4j.ogm.session.Session; import org.neo4j.ogm.session.SessionFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @Configuration @EnableNeo4jRepositories("com.app.repository") @EnableTransactionManagement @ComponentScan("com.app") public class AppNeo4jConfiguration extends Neo4jConfiguration{ public SessionFactory getSessionFactory() { return new SessionFactory("com.app.bo"); } @Bean public Neo4jServer neo4jServer() { return new RemoteServer("http://localhost:7474"); } @Bean @Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS) public Session getSession() throws Exception { return super.getSession(); } }