使用 Spring Data Neo4J 3.3.1 创建数据库时,Neo4j 2.2.3 服务器无法启动
Neo4j 2.2.3 server fails to start when database is created using Spring Data Neo4J 3.3.1
我在创建 Spring Data Neo4j 应用程序时遵循了这个 guide。
我已经包括:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.3.1.RELEASE</version>
</dependency>
在我的pom.xml
尝试启动服务器时出现以下错误:
"Starting Neo4j Server failed: Component
'org.neo4j.server.database.LifecycleManagingDatabase@' was
successfully initialized, but failed to start."
消息日志显示:
"Error starting org.neo4j.kernel.EmbeddedGraphDatabase"
我了解到 Spring Data Neo4j 和 Neo4j 服务器版本可能彼此不兼容。
问题:如何知道哪些版本兼容?
堆栈跟踪:
2015-07-09 13:03:56.231+0000 INFO [o.n.k.EmbeddedGraphDatabase]: Shutdown started
2015-07-09 13:03:56.244+0000 ERROR [o.n.s.d.LifecycleManagingDatabase]: Failed to start database.
java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, D:\neo4j
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.database.LifecycleManagingDatabase.newGraphDatabase(LifecycleManagingDatabase.java:44) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:110) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:203) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.desktop.runtime.DatabaseActions.start(DatabaseActions.java:71) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.desktop.ui.StartDatabaseActionListener.run(StartDatabaseActionListener.java:61) [neo4j-desktop-2.2.3.jar:2.2.3]
at java.awt.event.InvocationEvent.dispatch(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.access0(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.run(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.run(Unknown Source) [na:1.7.0_75]
at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_75]
at java.security.ProtectionDomain.doIntersectionPrivilege(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.dispatchEvent(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.run(Unknown Source) [na:1.7.0_75]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.state.DataSourceManager@5a7c7505' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331) ~[neo4j-desktop-2.2.3.jar:2.2.3]
... 22 common frames omitted
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@50f074ae' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:117) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
... 24 common frames omitted
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UpgradingStoreVersionNotFoundException: 'neostore.nodestore.db' does not contain a store version, please ensure that the original database was shut down in a clean state.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:86) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreMigrator.needsMigration(StoreMigrator.java:158) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.getParticipantsEagerToMigrate(StoreUpgrader.java:259) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:134) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:564) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:460) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
... 27 common frames omitted
2015-07-09 13:03:56.244+0000 INFO [o.n.s.CommunityNeoServer]: Successfully shutdown Neo4j Server.
我确实按照 Michael Hunger 的说法通过关闭流解决了问题(误解了关闭 spring 应用程序的含义)。
即
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("appContext.xml");
context.close();
目前没有显示 Spring Data Neo4j 与 Neo4j 版本兼容性的中央列表。不过,这将非常有帮助,因为当使用不兼容的版本时,SDN 往往会抛出奇怪的异常,例如
我在创建 Spring Data Neo4j 应用程序时遵循了这个 guide。
我已经包括:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.3.1.RELEASE</version>
</dependency>
在我的pom.xml
尝试启动服务器时出现以下错误:
"Starting Neo4j Server failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@' was successfully initialized, but failed to start."
消息日志显示:
"Error starting org.neo4j.kernel.EmbeddedGraphDatabase"
我了解到 Spring Data Neo4j 和 Neo4j 服务器版本可能彼此不兼容。
问题:如何知道哪些版本兼容?
堆栈跟踪:
2015-07-09 13:03:56.231+0000 INFO [o.n.k.EmbeddedGraphDatabase]: Shutdown started
2015-07-09 13:03:56.244+0000 ERROR [o.n.s.d.LifecycleManagingDatabase]: Failed to start database.
java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, D:\neo4j
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.database.LifecycleManagingDatabase.newGraphDatabase(LifecycleManagingDatabase.java:44) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:110) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:203) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.desktop.runtime.DatabaseActions.start(DatabaseActions.java:71) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.desktop.ui.StartDatabaseActionListener.run(StartDatabaseActionListener.java:61) [neo4j-desktop-2.2.3.jar:2.2.3]
at java.awt.event.InvocationEvent.dispatch(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.access0(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.run(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.run(Unknown Source) [na:1.7.0_75]
at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_75]
at java.security.ProtectionDomain.doIntersectionPrivilege(Unknown Source) [na:1.7.0_75]
at java.awt.EventQueue.dispatchEvent(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.7.0_75]
at java.awt.EventDispatchThread.run(Unknown Source) [na:1.7.0_75]
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.state.DataSourceManager@5a7c7505' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331) ~[neo4j-desktop-2.2.3.jar:2.2.3]
... 22 common frames omitted
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@50f074ae' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:117) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
... 24 common frames omitted
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UpgradingStoreVersionNotFoundException: 'neostore.nodestore.db' does not contain a store version, please ensure that the original database was shut down in a clean state.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:86) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreMigrator.needsMigration(StoreMigrator.java:158) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.getParticipantsEagerToMigrate(StoreUpgrader.java:259) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:134) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:564) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:460) ~[neo4j-desktop-2.2.3.jar:2.2.3]
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-desktop-2.2.3.jar:2.2.3]
... 27 common frames omitted
2015-07-09 13:03:56.244+0000 INFO [o.n.s.CommunityNeoServer]: Successfully shutdown Neo4j Server.
我确实按照 Michael Hunger 的说法通过关闭流解决了问题(误解了关闭 spring 应用程序的含义)。
即
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("appContext.xml"); context.close();
目前没有显示 Spring Data Neo4j 与 Neo4j 版本兼容性的中央列表。不过,这将非常有帮助,因为当使用不兼容的版本时,SDN 往往会抛出奇怪的异常,例如