gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 08:07:29 25 4
gpt4 key购买 nike

当我使用Spring-Data-Neo4J3.2.1.RELEASE版本和Neo4J2.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

这是因为我们的依赖项版本不兼容。那么,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

最佳答案

您必须使用 3.4.0.M1 或 3.3.1(本周到期),它们都提供与 Neo4j 2.2.2 的兼容性

关于java - Spring-Data-Neo4J:Spring-Data-Neo4j 如何管理 Neo4J 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30895097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com