neo4j螺栓连接卡住

时间:2017-02-14 09:47:33

标签: java neo4j

我通过neo4j-java-driver将neo4j-community-3.1.1连接到这样的非本地服务器:

function limiter() {
  var tex = $("#msg").val(); // get the value of the form input (textarea) and store it in tex variable
  $(".speech").html(tex); // set the value as innerHTML of the element(s) with 'speech' class
}

但它永远不会达到" System.out.println("会话打开...");" 很明显,当" driver.session();"

时,它会被卡住

我确定网络正常运行,我已经通过" telnet 10.209.20.211 7687"进行了测试。

neo4j.conf文件如下:

    Driver driver = GraphDatabase.driver("bolt://10.209.20.211:7687",
            AuthTokens.basic("username", "xxxx"));
    System.out.println("neo4j driver created..");
    Session session = driver.session();
    System.out.println("session opened..");

现在,问题是什么?

1 个答案:

答案 0 :(得分:0)

我通过以下代码解决了这个问题:

Config cfg = Config.build().withEncryptionLevel(Config.EncryptionLevel.NONE).toConfig();
Driver driver = GraphDatabase.driver("bolt://10.209.20.211:7687",
        AuthTokens.basic("username", "xxxx"), cfg);
System.out.println("neo4j driver created..");
Session session = driver.session();
System.out.println("session opened..");