neo4j-ogm: Provider HttpDriver not found for version 2.0.5

After updating ogm to v2.0.5, it is not able to load bolt driver if http dependency is not declared. My gradle dependencies looks like:

dependencies {
    ...
    compile 'org.neo4j:neo4j-ogm-core:2.0.5'
    compile 'org.neo4j:neo4j-ogm-bolt-driver:2.0.5'
    // compile 'org.neo4j:neo4j-ogm-http-driver:2.0.5'  --> this is now required
}

Test:

  1. Make sure you do not have neo4j-ogm-http-driver declare as a dependency.
  2. Start your application and you’ll get the following exception:
Exception in thread "main" java.util.ServiceConfigurationError: org.neo4j.ogm.driver.Driver: Provider org.neo4j.ogm.drivers.http.driver.HttpDriver not found
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.neo4j.ogm.service.DriverService.load(DriverService.java:36)
    at org.neo4j.ogm.service.DriverService.load(DriverService.java:59)
    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:81)

Exception at: https://github.com/neo4j/neo4j-ogm/blob/master/api/src/main/java/org/neo4j/ogm/service/DriverService.java#L36

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@xenoterracide I assume you’ve set application.properties to an embedded URI? Spring Boot starter looks at the URI scheme to decide whether to initialise the http driver or the embedded driver.

application.properties

spring.data.neo4j.uri=file:///tmp/sdn-university.db
spring.data.neo4j.session.scope=session

That said, there are additional problems with going to 2.0.5 which you haven’t encountered yet, and that are related to transitive dependencies. Effectively, until spring boot releases a version based on 2.0.5 OGM (it’s built with 2.0.4), you’ll need to explicitly include all the 2.0.5 OGM jar files before any others.

I’ve just updated https://github.com/neo4j-examples/sdn4-university pom file accordingly, and it does work with the embedded driver.