Join GitHub today
Open a Bolt connector to your embedded instance to get GUI administration and other benefits. #7608
The documentation, specifically section 2.14 of http://neo4j.com/docs/java-reference/current/#tutorials-java-embedded says that enabling a bolt connector on an embedded instance allows you to get GUI administration and other benefits. However the documentation doesn't specify to to access the embedded instance using the Neo4j Browser.
I'm assuming I need to start the neo4j server first so that it's hosted by something. I also disabled bolt on the neo4j server so there wouldn't be a port conflict.
I have the following running in JBoss:
Once JBoss is started 7687 is open.
I checked the "Use bolt protocol when available" box and entered localhost:7687.
WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3
And the only thing I see in the developer console is:
Do you see anything obvious I'm not doing correctly?
@remilmi the log shows that you are trying to connect to
Make sure you open the browser at
Trying to connect the Neo4j browser to embedded neo instance (with Bolt connector enabled), it says "connected" and I initially see my nodes/labels/etc in the "Database View" sidebar, but I'm unable to run any queries/commands. After some time, it disconnects and reports "web socket connection failure".
Immediately upon connecting, I got the following exception (repeatedly) in the neo4j log:
We are running Neo4j 3.1.0 as an embedded graph.db and also would like to enable the 7474 neo4j HTTP browser as we did in 2.3.7.
Bottom line is:
3.0.7 brings up 7474 as a bolt port
In 3.1 the gui is different for the 3.0 procedure where a standalone browser is used to adjust the embedded graph.db - the bolt-http connector is still not up though.
cl: Add support for the bolt+routing protocol when in a Causal Cluster
To check - I switched back to 3.0.7 (deleted graph.db) - get different behaviour
likely because 7474 ends up configured with BOLT instead of HTTP
This is with or without the bolt settings applied on the factory and running only with
"not a WebSocket handshake request: missing upgrade"
A 400 this time
//I'll try 3.2.0-alpha02 when it comes up on maven central as well.
The KernelExtensionFactory impls contain only one Bolt subclass that could setup the 7687 and 7474 connectors. If I force the http connector as type BOLT - I register both of them (7474 is then a websocket port) - but this is not a solution.
It looks like we need to be running the connector setup that occurs in NeoServer and its subclasses down to EnterpriseNeoServer where we setup the following - however this code only runs for non-embedded servers
I did run into an issue with SSL creation during OPTIONAL (the default) only when a certain logging parameter was set to DEBUG - I'll raise a separate issue on this.
Just to verify our custom 4 level constructor override of GraphDatabaseService to load our custom HA listener is causing us connector deviation I ran a very basic embedded setup - same issue
graphDb GraphDatabaseFacade (id=198)
Attaching small maven war eclipse project used to test
referenced this issue
Dec 18, 2016
Anne's/J.F.'s workaround using 2 neo4j servers is good - I verified it on my setup - I get the same NPE as well.
Use the browser from a standalone to run queries against the embedded servers's bolt 7688 address without having to shutdown either graph.db
Ideally a procedure to wrap the embedded server' graphDatabaseFacade so that 7474 can be exposed via NeoServer code would be good in the future
The jmx exception does not block querying the db but should be looked at
It turns out with a bit of help from the following post we can still bring up a wrapping NeoServer around our embedded mode Neo4j 3.1.0 server. This code however is not integrated yet with our HA listener overrides on the constructor tree we bootstrap in Spring - so is a POC.
With this NeoServer wrapper code - we don’t need the secondary workaround where we bring up a 2nd Neo4j server mode instance, bring up its’ 7474 browser and modify the bolt address (default 7687) in the config to point to the exposed (7688) embedded mode graph.db - without bringing either Neo4j server down as long as they point to different graph.db instances - in effect sharing the 7474 browser as a bolt client.
Disclaimer: I believe a proper architecture involves a clustered set of server mode bolt enabled Neo4j servers.
FrontController/spring service bean starts graph
after opening browser
Debugging we see that we get the proper Jetty server available usually only to server mode Neo4j not embedded mode.
settings and logs
These errors are non-fatal related to JMX and can be fixed
7575 http and 7688 bolt ports
This code however is not integrated yet with our HA listener overrides on the constructor tree we bootstrap in Spring - the following scrubbed/distilled mirror POC of our corporate production code will be adjusted in the next post.
We can get an HA embedded mode server up wrapped by a NeoServer - working out passing parameters with TypeSafe again still.
haDB HighlyAvailableGraphDatabase (id=178)
example tomcat 8 war maven project for above POC
Add a node to the embedded graph db
In latest version of neo4j embedded mode, The inner class