I 'm having a hard time setting up my project using spring-data-neo4j and the new neo4j version 2.0 (as I would like to use the new Labels in neo4j)
After a bid of digging around, I found spring-data-neo4j 3.0.0.RC1 in the maven repositories. Also, I would like to use neo4j-spatial. Relevant maven dependencies are as follows defined:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.0.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.0.0.RC1</version>
<exclusions>
<exclusion>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.12-neo4j-2.0.0-M06</version>
</dependency>
The application context is following the examples on the project web site:
<context:annotation-config/>
<context:spring-configured/>
<context:component-scan base-package="org.some.packages"/>
<neo4j:config storeDirectory="target/my.db"/>
<neo4j:repositories base-package="org.some.packages.repository"/>
<tx:annotation-driven mode="proxy"/>
I do not use AspectJ.
When I start the project, I get the following exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someRepository': Invocation of init method failed; nested exception is org.neo4j.graphdb.TransactionFailureException: Unable to commit transaction
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:121)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
Caused by: org.neo4j.graphdb.TransactionFailureException: Unable to commit transaction
at org.neo4j.kernel.TopLevelTransaction.close(TopLevelTransaction.java:134)
at org.springframework.data.neo4j.support.DelegatingGraphDatabase.createIndex(DelegatingGraphDatabase.java:175)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.createIndex(IndexProviderImpl.java:91)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:68)
at org.springframework.data.neo4j.support.index.IndexProviderImpl.getIndex(IndexProviderImpl.java:108)
The ´´´someRepository´´´ bean that fails is a simple interface extending GraphRepository.
The setup worked with the latest stable release if spring-data-neo4j (which usses neo4j 1.9 under the hood)
Any ideas?
EDIT:
I have an attribute on one of my @NodeEntity
that has the following index definition:
@Indexed(indexType = IndexType.POINT, indexName = "someIndexName", unique = false)
If I remove this index, the application context can be started.