你能帮我解决一个问题吗?
我已经安装了 Neo4j 版本 2.0.0。我已经启动了服务器。我正在尝试通过 Java 客户端(Eclipse 中的 Java 代码)连接到它。 尽管在 Neo4j.properties 中设置了属性allow_store_upgrade=true,我仍然得到 异常(exception)。
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"
谁能帮帮我。拜托,我被这个问题困住了。
service = new GraphDatabaseFactory().newEmbeddedDatabase(Neo4jDBPath);
这一步失败了。请帮我。
最佳答案
您应该引用您的属性文件。 AFAIK,它不会从您的类路径中自动获取。
new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(storeDir)
.loadPropertiesFromFile(pathToConfig + "neo4j.properties")
.newGraphDatabase();
您也可以在java中配置它,如下所示:
new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(storeDir)
.setConfig( GraphDatabaseSettings.allow_store_upgrade, "true")
.newGraphDatabase();
有关详细信息,请参阅以下内容中的“使用配置设置启动嵌入式数据库”部分 page .
关于java - Neo4j 自动升级选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21617471/