当我使用Spring-Data-Neo4J
3.2.1.RELEASE
版本和Neo4J
版2.1.5
时,我的应用程序成功运行。当我将Neo4J
迁移到版本2.2.2
和Spring-Data-Neo4J
到3.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.RELEASE
与Neo4J 2.2.2
一起使用?
更新
在@MichaelHunger建议之后,我正在使用以下依赖项Spring-Data-neo4J 3.4.0.M1
和Neo4J 2.2.2
。所以我的以下依赖图是:
答案 0 :(得分:1)
你必须使用3.4.0.M1或3.3.1(本周到期)两者都提供与Neo4j 2.2.2的兼容性