Spring-Data-Neo4J: How Spring-Data-Neo4j manage Neo4J versions

162 Views Asked by At

When i am using Spring-Data-Neo4J with 3.2.1.RELEASE verison and Neo4J with 2.1.5, my application run successfully. When i migrate my Neo4J to version 2.2.2 and Spring-Data-Neo4J to 3.2.2.RELEASE i am getting the following exception:

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

This is because our dependencies version are not compatible. So, How Spring-Data-Neo4J manage versions of Neo4J?

Is it possible to use Spring-Data-Neo4J 3.2.2.RELEASE with Neo4J 2.2.2?

UPDATE

After @MichaelHunger suggestion, i am using following dependencies Spring-Data-neo4J 3.4.0.M1 and Neo4J 2.2.2. So my following dependency graph is:

Dependency Graph

1

There are 1 best solutions below

4
On

You have to use 3.4.0.M1 or 3.3.1 (which is due this week) both of which provide compatibility with Neo4j 2.2.2