Neo4J螺栓连接器不工作

时间:2017-11-14 11:57:35

标签: neo4j

我正在尝试启动Neo4J嵌入式数据库(3.2.0),然后通过bolt驱动程序(1.4.4)从另一个jvm进程访问此数据库。虽然我的代码下面是打印sysout,表明db已经启动,

    System.out.println("Starting Neo embedded database at " + databaseFile);
    BoltConnector bolt = new BoltConnector("key");
    service = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(new File(databaseFile))
            .setConfig(bolt.enabled, "true").setConfig(bolt.type, "BOLT")
            .setConfig(bolt.encryption_level, "DISABLED").newGraphDatabase();
    System.out.println("Started Neo embedded database");

我在同一台机器上运行的另一个jvm进程尝试通过bolt驱动程序查询db失败,错误如下:

Exception in thread "main" 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.
at org.neo4j.driver.internal.net.SocketClient.start(SocketClient.java:132)
at org.neo4j.driver.internal.net.SocketConnection.startSocketClient(SocketConnection.java:92)
at org.neo4j.driver.internal.net.SocketConnection.<init>(SocketConnection.java:67)
at org.neo4j.driver.internal.net.SocketConnector.createConnection(SocketConnector.java:77)
at org.neo4j.driver.internal.net.SocketConnector.connect(SocketConnector.java:50)
at org.neo4j.driver.internal.net.pooling.SocketConnectionPool$ConnectionSupplier.get(SocketConnectionPool.java:216)
at org.neo4j.driver.internal.net.pooling.SocketConnectionPool$ConnectionSupplier.get(SocketConnectionPool.java:198)
at org.neo4j.driver.internal.net.pooling.BlockingPooledConnectionQueue.acquire(BlockingPooledConnectionQueue.java:96)
at org.neo4j.driver.internal.net.pooling.SocketConnectionPool.acquireConnection(SocketConnectionPool.java:149)
at org.neo4j.driver.internal.net.pooling.SocketConnectionPool.acquire(SocketConnectionPool.java:76)
at org.neo4j.driver.internal.DirectConnectionProvider.acquireConnection(DirectConnectionProvider.java:47)
at org.neo4j.driver.internal.DirectConnectionProvider.verifyConnectivity(DirectConnectionProvider.java:67)
at org.neo4j.driver.internal.DirectConnectionProvider.<init>(DirectConnectionProvider.java:41)
at org.neo4j.driver.internal.DriverFactory.createDirectDriver(DriverFactory.java:109)
at org.neo4j.driver.internal.DriverFactory.createDriver(DriverFactory.java:93)
at org.neo4j.driver.internal.DriverFactory.newInstance(DriverFactory.java:67)
at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:135)
at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:117)
at 
Caused by: java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.neo4j.driver.internal.net.ChannelFactory.connect(ChannelFactory.java:79)
    at org.neo4j.driver.internal.net.ChannelFactory.create(ChannelFactory.java:41)
    at org.neo4j.driver.internal.net.SocketClient.start(SocketClient.java:126)
    ... 20 more

在Windows上运行netstat并不会显示任何正在侦听端口7687的进程,有人可以帮忙。

0 个答案:

没有答案