我设置了我的neo4j,但它得到了导出错误
Configuration cfg = Components.configuration();
cfg.driverConfiguration()
.setDriverClassName("org.neo4j.ogm.drivers.http.driver.HttpDriver")
.setURI("http://localhost:7474")
.setCredentials("neo4j","neo4j");
SessionFactory sessionFactory = new SessionFactory(cfg,"rdf2rdf.domain");
//Session session = Neo4jSessionFactory.getInstance().getNeo4jSession();
Session session = sessionFactory.openSession();
但是收到错误!!!
Exception in thread "main" org.neo4j.ogm.exception.ServiceNotFoundException: Driver: null
at org.neo4j.ogm.service.DriverService.load(DriverService.java:51)
at org.neo4j.ogm.service.DriverService.load(DriverService.java:63)
at org.neo4j.ogm.service.Components.loadDriver(Components.java:126)
at org.neo4j.ogm.service.Components.driver(Components.java:84)
at org.neo4j.ogm.session.SessionFactory.openSession(SessionFactory.java:79)
at rdf2rule.rdf2rule.App.main(App.java:48)
看来我的sessionfacotry错了!谁能帮我?请。
答案 0 :(得分:1)
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-http-driver</artifactId>
<version>2.0.1</version>
</dependency>
另外,请改变
Configuration cfg = Components.configuration();
到
Configuration cfg = new Configuration();