0
votes

I am trying to setup a Java project which uses Spring-Neo4j and Neo4j but unable to get around with dependency issues. I am using maven for dependency management and have tried several version combinations of Spring, Spring Neo4j and Neo4j.

spring: 3.2.6.RELEASE

spring-data-neo4j: 3.0.0.RELEASE

neo4j: 2.0.1

application-context.xml file

<neo4j:config storeDirectory="data/graph.db" /> 

Error:

Caused by: org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
at org.neo4j.kernel.impl.storemigration.ConfigMapUpgradeConfiguration.checkConfigurationAllowsAutomaticUpgrade(ConfigMapUpgradeConfiguration.java:39)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.attemptUpgrade(StoreUpgrader.java:71)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.tryToUpgradeStores(StoreFactory.java:144)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.newNeoStore(StoreFactory.java:119)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:323)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:503)
... 64 more

I have enabled allow_store_upgrade=true in my neo4j.properties file.

2
Are you sure the data store has been cleanly shutdown with the old version prior to upgrade? - Stefan Armbruster

2 Answers

0
votes

Your embedded neo4j most likely doesn't pick up the neo4j file (this documentation says you need to set it manually).

Initialise your neo4j like this

<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
        destroy-method="shutdown">
    <constructor-arg index="0" value="target/config-test"/>
<!-- optionally pass in neo4j-config parameters to the graph database
    <constructor-arg index="1">
        <map>
            <entry key="allow_store_upgrade" value="true"/>
        </map>
    </constructor-arg>
-->
</bean>

<neo4j:config graphDatabaseService="graphDatabaseService"/>

Source: http://docs.spring.io/spring-data/data-neo4j/docs/3.0.1.RELEASE/reference/html/setup.html#d0e3597

0
votes

I'm trying to use spring-data-neo4j 3.1.1.RELEASE and neo4j 2.1.2 and I think this is incomplete. Indeed, at least with these versions, map is not optionnal. Moreover there is a third mandatory argument in constructor of type Dependencies. The problem is that I don't really know what is this third parameter and moreover EmbeddedGraphDatabase and Dependecies are deprecated. Do you know which is the good way to start a webapp (with these versions) in embedded mode ?