我所要做的就是以下几点:
BatchInserter ins = BatchInserters.inserter("target/batchinserter-example");
其中"target/batchinserter-example"
是给定的商店目录。编译很好,但我得到了:
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.neo4j.unsafe.batchinsert.BatchInserterImpl.rejectAutoUpgrade(BatchInserterImpl.java:556)
at org.neo4j.unsafe.batchinsert.BatchInserterImpl.<init>(BatchInserterImpl.java:219)
at org.neo4j.unsafe.batchinsert.BatchInserters.inserter(BatchInserters.java:94)
at org.neo4j.unsafe.batchinsert.BatchInserters.inserter(BatchInserters.java:88)
at org.neo4j.unsafe.batchinsert.BatchInserters.inserter(BatchInserters.java:63)
at org.neo4j.unsafe.batchinsert.BatchInserters.inserter(BatchInserters.java:51)
at NeoBatchInserter.main(NeoBatchInserter.java:26)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.neo4j.graphdb.factory.GraphDatabaseSettings.<clinit>(GraphDatabaseSettings.java:69)
... 7 more
我不明白这是怎么回事。我实际上只是调用一个String
的构造函数。我此刻非常沮丧。如果有更好的方法,我欢迎尝试。我想做的就是设置一个BatchInserter
(从头开始),以便我可以开始工作。
修改:
我只是试图从测试图中指出graph.db
,但这仍然不起作用......
我也在使用kernel.2.1.3
编辑2 : 由于我的服务器是2.1.2,我将我的罐子改为2.1.2版本,但我仍然得到同样的错误。
答案 0 :(得分:1)
使用什么版本的Neo4j创建了目录?我很确定你不能在早期版本中使用2.1.3的batchinserter。
安装2.1.3,在neo4j.properties中设置allow_store_upgrade=true
,启动服务器并关闭它。干净关闭至关重要。然后使用您的batchinserter代码。