Neo4j, Blueprint и UpgradeNotAllowedByConfigurationException
Я опускаю пальцы в воду Neo4j и сталкиваюсь со следующей ошибкой:
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
Однако я изменил свойства neo4j.properties:
Включите это, чтобы иметь возможность обновить магазин с более старой версии
allow_store_upgrade= верно
Я использую Blueprints и Blueprints-emf. Вот мой код:
@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();
}
}
1 ответ
Решение
У меня такая же проблема. Я добавил следующую зависимость вместе с blueprints
те, и я смог запустить мой тест.
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>2.1.7</version>
</dependency>