neo4jemftinkerpop-blueprint

Neo4j, Blueprint and UpgradeNotAllowedByConfigurationException


I am dipping my toes in the Neo4j water, and am running into the following 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)
    ... 37 more

I have, however, modified the neo4j.properties to include:

Enable this to be able to upgrade a store from an older version

allow_store_upgrade=true

I am using Blueprints and Blueprints-emf. Here is my code:

@ApplicationScoped
public class EmfPersistance {

    public void testCall() throws IOException{      

        EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
        EPackage.Registry.INSTANCE.put(DomainPackage.eNS_URI, DomainPackage.eINSTANCE);        


        Neo4j2Graph graph = new Neo4j2Graph("/home/anton/Documents/software/neo4j/neo4j-community-2.1.7/data/graph.db");

        ResourceSet resourceSet = new ResourceSetImpl();
        resourceSet
            .getResourceFactoryRegistry()
            .getExtensionToFactoryMap()
            .put("*", new BlueprintsResourceFactory(graph));

        resourceSet
            .getURIConverter()
            .getURIHandlers()
            .add(0, new GraphHandler());


        Application app = DomainFactory.eINSTANCE.createApplication();
        app.setIdentifier("hello");
        User user = DomainFactory.eINSTANCE.createUser();
        user.setActualName("user");
        user.setUsername("user");
        user.setEmailAddress("email@gmail.com");



        Resource resource = resourceSet.createResource(URI.createURI("graph:/my/graph/users"));
        resource.getContents().add(user);
        resource.save(null);

        graph.shutdown();
    }

}

Solution

  • I had the same problem. I added the following dependency along with the blueprints ones and I was able to get my test to run.

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>2.1.7</version>
    </dependency>