Spring-Data-Neo4J:Spring-Data-Neo4j如何管理Neo4J版本

时间:2015-06-17 14:50:36

标签: java spring exception neo4j spring-data-neo4j

当我使用Spring-Data-Neo4J 3.2.1.RELEASE版本和Neo4J2.1.5时,我的应用程序成功运行。当我将Neo4J迁移到版本2.2.2Spring-Data-Neo4J3.2.2.RELEASE时,我收到以下异常:

Caused by: java.lang.NoClassDefFoundError: org/neo4j/kernel/impl/transaction/SpringTransactionManager
at org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean.createTransactionManagerForOnePointEight(JtaTransactionManagerFactoryBean.java:110)
at org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean.createJtaTransactionManager(JtaTransactionManagerFactoryBean.java:91)
at org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean.create(JtaTransactionManagerFactoryBean.java:65)
at org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean.<init>(JtaTransactionManagerFactoryBean.java:35)
at com.harmeetsingh13.config.Neo4jConfig.neo4jTransactionManagerFactoryBean(Neo4jConfig.java:48)
at com.harmeetsingh13.config.Neo4jConfig.neo4jTransactionManager(Neo4jConfig.java:66)
at com.harmeetsingh13.config.Neo4jConfig$$EnhancerBySpringCGLIB$$f77a14f4.CGLIB$neo4jTransactionManager$1(<generated>)
at com.harmeetsingh13.config.Neo4jConfig$$EnhancerBySpringCGLIB$$f77a14f4$$FastClassBySpringCGLIB$$b430987b.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
at com.harmeetsingh13.config.Neo4jConfig$$EnhancerBySpringCGLIB$$f77a14f4.neo4jTransactionManager(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
... 81 more
Caused by: java.lang.ClassNotFoundException: org.neo4j.kernel.impl.transaction.SpringTransactionManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1333)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1180)
... 97 more

这是因为我们的dependencies版本不兼容。那么,Spring-Data-Neo4J如何管理Neo4J的版本?

是否可以将Spring-Data-Neo4J 3.2.2.RELEASENeo4J 2.2.2一起使用?

更新

在@MichaelHunger建议之后,我正在使用以下依赖项Spring-Data-neo4J 3.4.0.M1Neo4J 2.2.2。所以我的以下依赖图是:

Dependency Graph

1 个答案:

答案 0 :(得分:1)

你必须使用3.4.0.M1或3.3.1(本周到期)两者都提供与Neo4j 2.2.2的兼容性