Access the neo4j browser while running an embedded connection with a bolt connector

爷,独闯天下 提交于 2019-12-21 04:31:33

问题


My project is in Java, and I create an embedded connection to my Neo4j database and add a "bolt" connector to it as described in the documentation here:

http://neo4j.com/docs/java-reference/current/#tutorials-java-embedded

the code is:

GraphDatabaseSettings.BoltConnector bolt = GraphDatabaseSettings.boltConnector("0");

graphDb = new GraphDatabaseFactory()
    .newEmbeddedDatabaseBuilder(new File("C:/.../default.graphdb"))
    .setConfig(bolt.enabled, "true")
    .setConfig(bolt.address, "localhost:7687")
    .newGraphDatabase();

According to the Neo4j documentation I would think that I could now connect to the database using the browser based on "By default, Neo4j Embedded does not expose a Bolt connector, but you can enable one. Doing so allows you to connect the services Neo4j Browser to your embedded instance." However, if I run the code, while I am able to programmatically perform all that I need to, I cannot access the browser at localhost:7474 nor localhost:7687

My question is: Is this just really poorly worded documentation and this is not actually a supported capability? Or is there an undocumented way of connecting to the database through the bolt connection created in the code that would allow me to view the data using the Neo4j browser while running my embedded connection?

Edit: I am already using the bolt driver library


回答1:


You need to place the neo4j-bolt-3.0.3 jar in the working directory where your code is executing so that Neo4j can load it. The Bolt connector is a kernel extension.

I managed to get the Neo4j Browser to connect and work with the embedded instance, by first starting up a Neo4j server (standalone) instance separately and having my web browser cache the Neo4j Browser. Then under the Neo4j Browser settings checking the "Use Bolt protocol when available" setting and setting "Bolt host" to the address of my embedded instance. Then shutting down the standalone server instance. I don't know if it is the supported approach, but seems to work well enough for me.

I have not configured my embedded instance to use authentication.



来源:https://stackoverflow.com/questions/38077512/access-the-neo4j-browser-while-running-an-embedded-connection-with-a-bolt-connec

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!