Org.neo4j.ogm.exception.ServiceNotFoundException: Driver: org.neo4j.ogm.drivers.http.driver.HttpDriver

I am new to Neo4J and trying to connect to a Neo4J server through java.

My pom entries for a single project:

<dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-core</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-http-driver</artifactId> <version>2.0.1</version> </dependency> <dependency> 

This project is on the way to the Java EE project classes and is deploying as a war on tomcat.

My code is trying to open a session as follows:

 Configuration configuration = Components.configuration(); configuration.driverConfiguration() .setDriverClassName("org.neo4j.ogm.drivers.http.driver.HttpDriver") .setURI("http://localhost:7474") .setCredentials("xxxx", "xxxx"); SessionFactory sessionFactory = new SessionFactory("com.myapp.infra.transaction"); sessionFactory.openSession(); 

The last line throws the following error:

 org.neo4j.ogm.exception.ServiceNotFoundException: Driver: org.neo4j.ogm.drivers.http.driver.HttpDriver 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) 

Do not use Spring, but the code uses JDK 7. Any help would be really helpful.

Thanks!:)

+6
source share
1 answer

Use Configuration config = new Configuration();

You cannot reconfigure an existing configuration. The Components.configuration() method should have been removed in 2.0.1, but it was left out. This method is deprecated and will be removed in a future version.

We will update the documentation on this subject as soon as possible. Sorry for any confusion.

0
source

All Articles