尝试从 java 连接到 Neo4j 我收到以下错误:
线程“main”java.lang.RuntimeException 中的异常:在 org.neo4j 的 org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:323) 处启动 org.neo4j.kernel.EmbeddedGraphDatabase 时出错。 kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.java:100) at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:92) at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:197)在 org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69) 在.....
原因:org.neo4j.kernel.lifecycle.LifecycleException:组件'org.neo4j.kernel.impl.transaction.XaDataSourceManager@4514ba77'已成功初始化,但无法启动。请参阅附件原因异常。在 org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504) 在 org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) 在 org.neo4j.kernel.InternalAbstractGraphDatabase.run (InternalAbstractGraphDatabase.java:300)
... 7 more Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component
'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource@2c86c977' 初始化成功,但启动失败。请参阅附件原因异常。在 org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504) 在 org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) 在 org.neo4j.kernel.impl.transaction .XaDataSourceManager.start(XaDataSourceManager.java:165) 在 org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)
... 9 more Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider
成立。类路径上可用的内核扩展:
类路径条目:org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:136) 中的 /...../java/....xyz.jar org.neo4j.kernel.api .index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:128) at org.neo4j.kernel.extension.KernelExtensions.resolveDependency(KernelExtensions.java:207) at org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl.resolveDependency(InternalAbstractGraphDatabase.java: 1403) 在 org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:311) 在 org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498) ... 12更多的
我使用的是 Ne04j-2.0.0-M05 版本,在 linux 机器上运行 Java 7 下的 java 代码。相同的 jar 文件和 java 代码在 Windows 机器上运行良好。Web 管理界面运行良好(因此 db 的路径可能不是问题,因为我在 org.neo4j.server.database.location 和 org.neo4j.server.webadmin.data.uri 中给出了相同的路径),
我用来连接的java代码是:
String dbpath = "/NEO4J_HOME/data/graph.db/";
graphdb = new GraphDatabaseFactory().newEmbeddedDatabase(dbpath);
你能说出什么可能导致java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found