我开始学习neo4j DB。我的测试代码如下:
@Test
public void persistedMovieShouldBeRetrievableFromGraphDb() {
GraphDatabaseService graphDB = new EmbeddedGraphDatabase("data/graph.db");
registerShutdownHook(graphDB);
Transaction tx = graphDB.beginTx();
try{
Neo4jTemplate template = new Neo4jTemplate(graphDB);
Movie forrestGump = template.save(new Movie("Forrest Gump", 1994));
Movie retrievedMovie = template.findOne(forrestGump.getId(), Movie.class);
assertEquals("Retrieved Movie matched persisted one", forrestGump, retrievedMovie);
assertEquals("retrieved movie title matches", "Forrest Gump", retrievedMovie.getTitle());
}
finally{
tx.finish();
}
}
但是,它总是给出一个例外:
java.lang.NoSuchMethodError: org.neo4j.kernel.impl.transaction.SpringTransactionManager.<init>(Lorg/neo4j/kernel/GraphDatabaseAPI;)V