当我尝试使用
访问此目录时,我的.db存入/home/gaurav/sharing/graph.dbGraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(new File("/home/gaurav/sharing/graph.db/"));
我收到以下错误:(我不是以root用户身份使用eclipse)
java.lang.RuntimeException:启动时出错 org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /home/gaurav/sharing/graph.db at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:193) 在 org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:124) 在 org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:101) 在 org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda $ createDatabaseCreator $ 0(GraphDatabaseFactory.java:89) 在 org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183) 在 org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:66) 在 org.caleydo.neo4j.plugins.kshortestpaths.AppTest.run(AppTest.java:212) 在 org.caleydo.neo4j.plugins.kshortestpaths.AppTest.test0_2(AppTest.java:311) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498)at junit.framework.TestCase.runTest(TestCase.java:154)at junit.framework.TestCase.runBare(TestCase.java:127)at junit.framework.TestResult $ 1.protect(TestResult.java:106)at junit.framework.TestResult.runProtected(TestResult.java:124)at at junit.framework.TestResult.run(TestResult.java:109)at junit.framework.TestCase.run(TestCase.java:118)at junit.framework.TestSuite.runTest(TestSuite.java:208)at junit.framework.TestSuite.run(TestSuite.java:203)at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121) 在 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) 在 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) 在 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) 在 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) 在 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 引起:org.neo4j.kernel.lifecycle.LifecycleException:Component ' org.neo4j.kernel.NeoStoreDataSource@386112d6'成功了 初始化,但未能启动。请参阅附件原因例外。 在 org.neo4j.kernel.lifecycle.LifeSupport $ LifecycleInstance.start(LifeSupport.java:443) 在org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) 在 org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100) 在 org.neo4j.kernel.lifecycle.LifeSupport $ LifecycleInstance.start(LifeSupport.java:433) 在org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) 在 org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:189) ... 25更多引起: org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: 无法使用较旧的数据存储版本启动Neo4j。启用 自动升级,请设置配置参数 " dbms.allow_format_migration =真"在 org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:116) 在 org.neo4j.kernel.impl.storemigration.DatabaseMigrator.migrate(DatabaseMigrator.java:98) 在 org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:571) 在 org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:440) 在 org.neo4j.kernel.lifecycle.LifeSupport $ LifecycleInstance.start(LifeSupport.java:433) ......还有30多个
答案 0 :(得分:0)
堆栈跟踪的最后一部分说:
无法使用较旧的数据存储版本启动Neo4j。启用 自动升级,请设置配置参数 “dbms.allow_format_migration =真”
您应该创建新的数据存储区或将上面的标记设置为true。