在 java 中创建 GraphDB 对象时,我遇到了这个奇怪的错误。我的 neo4j 版本:2.2.5
我的代码:
public static void main(String[] args) throws FileNotFoundException,
IOException, ParseException {
GraphDatabaseService graphdb = new GraphDatabaseFactory()
.newEmbeddedDatabase(dbLocation);
System.out.println("GraphDb started");
但是,它抛出以下错误:
Exception in thread "main" java.lang.NoSuchMethodError: org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory.<init>(Lorg/neo4j/io/fs/FileSystemAbstraction;)V
at org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory.<init>(ConfiguringPageCacheFactory.java:47)
at org.neo4j.kernel.InternalAbstractGraphDatabase.createPageCache(InternalAbstractGraphDatabase.java:715)
at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:486)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:324)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:95)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:176)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:67)
at com.spnotes.kafka.Readlog.main(Readlog.java:26)
早些时候我的代码运行良好。想不出原因。谢谢