2013-08-26 67 views
0

我收到以下錯誤,同時連接到的Neo4j:Java程序無法在Neo4j的數據庫中創建鎖定

Exception in thread "main" java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component '[email protected]' was successfully initialized, but failed to start. Please see attached cause exception. 
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:281) 
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106) 
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88) 
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207) 
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69) 
at com.neo4j.NeoStart.createDatabase(NeoStart.java:41) 
at com.neo4j.NeoStart.main(NeoStart.java:26) 
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component '[email protected]' was successfully initialized, but failed to start. Please see attached cause exception. 
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497) 
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104) 
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:259) 
... 6 more 
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file 
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74) 
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40) 
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491) 

我已經安裝的Neo4j爲:apt-get的在Ubuntu安裝的Neo4j 12.04

我使用的DB_PATH如下: private static final String neo4j_DB_PATH =「/var/lib/neo4j/data/graph.db」;

請幫我解決這個問題...

+3

最有可能你正在啓動多個數據庫。 Neo4j只允許一個程序一次編輯/讀取數據庫文件。 – Nicholas

回答

2

你確定這其中的Neo4j服務器使用uid具有寫權限的數據目錄?你確定沒有多個實例在運行嗎?您可以在終端上使用ps axf|grep neo4j進行檢查。

+0

感謝您的回覆......我嘗試了一些可能的解決方案,如更改目標數據庫文件的猜測...... Woela ...它的工作....所以由於某種原因,該位置無法訪問...我改變了DB_PATH到「/var/lib/neo4j/data/random_name.db」。 – Galaxy

+0

另一件事:'私有靜態最終字符串neo4j_DB_PATH =「/ var/lib/neo4j/data/graph.db」;'聽起來像你正在從你自己的java程序訪問相同的數據庫路徑,你安裝的neo4j服務器apt does。因此,如果您在運行級別配置中禁用neo4j服務器的自動啓動,則應能夠訪問該數據庫(當權限正確時)。 – h3nrik

相關問題