Java org.neo4j.driver.v1无法连接到Neo4j 3.3.2

时间:2018-03-06 04:53:40

标签: java neo4j graph-databases

我有一个neo4j数据库设置,我已经通过浏览器登录并正确设置了密码:

以下 python 代码WORKS:

>>> from neo4j.v1 import GraphDatabase, basic_auth
>>> driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "pass"))

但是,当我尝试使用 Java (org.neo4j.driver:neo4j-java-driver:1.4.4)进行连接时:

Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "pass") );

我得到了一个持续拒绝的连接:

org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it.
...
Caused by: java.net.ConnectException: Connection refused

这导致相信存在某种身份验证问题(密码错误?)但是,由于我通过Python成功连接,因此显然不是这样。

0 个答案:

没有答案