Error when using v1.7.x Java driver with Neo4j 4.x

Trying to connect our existing app using v1.7.5 java driver to neo4j-4.x server but keep getting

Caused by: org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Connection to the database terminated. This can happen due to network instabilities, or due to restarts of the database
	at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:123)
	at org.neo4j.driver.internal.DriverFactory.verifyConnectivity(DriverFactory.java:349)
	at org.neo4j.driver.internal.DriverFactory.newInstance(DriverFactory.java:95)
	at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:141)
	at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:124)

Does v1.7.5 suppose to work with neo4j 4.x?

Please use Java Driver 4.0 for Neo4j 4.x.
Driver 1.7 is compatible with 3.5, 3.4 and 3.3 servers.
Driver 4.0 is compatible with 4.0, 3.5 servers.
https://github.com/neo4j/neo4j-java-driver/wiki

You can absolutely use a 1.x Driver with a 4.x server. This is fully supported.

But bear in mind a couple of caveats if you do:

  • You will be working in 3.x fallback mode, so 4.x functionality (e.g. multidatabase) won't be available.
  • The default encryption settings have changed, so you will need to set encrypted=False in this combination (Neo4j 4.x no longer ships with a self-signed certificate)
3 Likes