0

I regularly use Neo4J Browser on http://localhost:7474/browser/. However, yesterday I used the java driver to connect to Neo4J and execute queries. Since then, I'm unable to login to Neo4J Browser.

I start Neo4J from the terminal (I'm on ubuntu) using sudo neo4j start, and this is the output -

 % sudo neo4j start
Active database: graph.db
Directories in use:
  home:         /var/lib/neo4j
  config:       /etc/neo4j
  logs:         /var/log/neo4j
  plugins:      /var/lib/neo4j/plugins
  import:       /var/lib/neo4j/import
  data:         /var/lib/neo4j/data
  certificates: /var/lib/neo4j/certificates
  run:          /var/run/neo4j
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
/usr/share/neo4j/bin/neo4j: line 411: /var/run/neo4j/neo4j.pid: No such file or directory

Then, I visit localhost:7474, which gives me the :server connect screen, but as soon as I enter the password, I get this error -

ServiceUnavailable: 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

Screenshot -

enter image description here

Normally, the only authentication fields are "Username" and "Password". I don't think I've seen the "Host" field in there before.

I searched for this error, and came across a question with similar error and an article on the Neo4J KB that says -

In Neo4j 3.0 and its implementation of the Bolt protocol, if a remote browser connects to Neo4j (http://:7474) and attempts to authenticate, the following error may be encountered:

But I don't think this situation applies here.

How can I fix this?

Manish Giri
  • 3,562
  • 8
  • 45
  • 81
  • 1
    is there something in the log file `/var/log/neo4j/debug.log` ? I'm not sure it's related to the use of the java-driver ... Have you done an upgrade of your system yesterday ? – logisima Oct 31 '17 at 10:50
  • Yes, there is a whole bunch of stuff in `debug.log`. I used `cat` to get all the logs into this [file](https://drive.google.com/open?id=0B3GlzFp0u2Wzb19ZbXFNVHpLcTA). I see this error repeated throughout the log - `java.lang.NoClassDefFoundError: Could not initialize class org.neo4j.bolt.v1.packstream.utf8.SunMiscUTF8Encoder ` – Manish Giri Oct 31 '17 at 11:09
  • 1
    The only change that I've done recently is to upgrade JDK 8 to 9, but that was more than a week back. – Manish Giri Oct 31 '17 at 11:13
  • 1
    For now, Neo4j is not yet compatible with java 9 – logisima Oct 31 '17 at 11:54
  • Is it a platform-specific issue? Because I just [tested](https://www.dropbox.com/s/bkwo94mzlsvthd4/neo.mov?dl=0) this on a borrowed mac running Java 9, and it worked fine there. – Manish Giri Nov 01 '17 at 09:29
  • There is two related issues on github : https://github.com/neo4j/neo4j-browser/issues/637 & https://github.com/neo4j/neo4j/issues/10336 – logisima Nov 01 '17 at 15:29
  • STILL not compatible with java 9 six months later? – uniqueID Apr 07 '18 at 05:11

1 Answers1

0

As logisima pointed out, neo4j is not compatible with Java 9. You can install multiple versions of Java and use environment variables to swap between them. For instance on MacOS you might have these two lines in your .bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)
export JAVA8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

The first line gets your normally installed java home and the second points to the older java8 location.

Then before starting your neo4j instance, execute for example:

export JAVA_HOME=$JAVA8_HOME
$NEO4J_HOME/bin/neo4j start
JMess
  • 623
  • 9
  • 11