If I remove the APOC (apoc-4.0.0.0-all) plugin it starts fine.
(running community edition 4.0 on Windows Server 2019)
Can anyone else confirm this, and if so I will submit a github issue (for APOC not neo4j correct?)
Thanks!
Here's the neo4j.log output:
2020-01-22 13:15:27 Apache Commons Daemon procrun stdout initialized.
2020-01-22 19:15:30.774+0000 INFO ======== Neo4j 4.0.0 ========
2020-01-22 19:15:30.805+0000 INFO Starting...
2020-01-22 19:15:36.352+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2042ccce' was successfully initialized, but failed to start. Please see the attached cause exception "null". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2042ccce' was successfully initialized, but failed to start. Please see the attached cause exception "null".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabaseService@2042ccce' was successfully initialized, but failed to start. Please see the attached cause exception "null".
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:45)
This is a bug in APOC 4.0.0. I guess you can workaround by using JDK instead of JRE - OpenJDK 11 should do, no need for the Oracle variant.
This should be fixed rather quickly, I'm on it.
APOC 4.0 uses a system property sun.java.command to figure out the location of the config dir. Here it has e.g. this value com.neo4j.server.enterprise.EnterpriseEntryPoint --home-dir=/home/stefan/neo4j-enterprise-4.0.0 --config-dir=/home/stefan/neo4j-enterprise-4.0.0/conf
Then we use the config dir to load apoc.conf.
I've tried various versions of JVM and JRE on my Linux machine. All of them do have a sun.java.command system property. However on your Windows Server box, debug.log shows that this system property does not exist. I have no clue why sun.java.command is missing.
It's easy to change the code to gracefully deal with this. However this has the consequence that you can't load apoc.conf and need to rely on setting env variables or system properties to configure apoc.
I don't have any JAVA background, so I'm not exactly sure what this means. Prior to n4j 4.0 I had 3.5x running using Java 8. N4J 4.0 said I had to use 11, so I uninstalled (Oracle) Java 8, and added OpenJDK 11, and here I sit.
Is there a way to add the sun.java.command system property on my Windows server?
You don't have to add it. Any JVM should do this on their own.
I've just asked a colleague to test it on Windows. He ran it on Windows 10 and there sun.java.command shows up. debug.log dumps all system properties upon startup. On his machine we got
2020-01-24 10:29:56.856+0000 INFO [o.n.i.d.DiagnosticsManager] VM Name: OpenJDK 64-Bit Server VM
2020-01-24 10:29:56.857+0000 INFO [o.n.i.d.DiagnosticsManager] VM Vendor: AdoptOpenJDK
2020-01-24 10:29:56.857+0000 INFO [o.n.i.d.DiagnosticsManager] VM Version: 11.0.1+13
....
2020-01-24 10:29:56.978+0000 INFO [o.n.i.d.DiagnosticsManager] --------------------------------------------------------------------------------
2020-01-24 10:29:56.979+0000 INFO [o.n.i.d.DiagnosticsManager] [ System properties ]
2020-01-24 10:29:56.979+0000 INFO [o.n.i.d.DiagnosticsManager] --------------------------------------------------------------------------------
...
2020-01-24 10:29:56.980+0000 INFO [o.n.i.d.DiagnosticsManager] sun.java.command = com.neo4j.server.enterprise.EnterpriseEntryPoint --config-dir=D:\Databases\Neo4j\Enterprise\neo4j-enterprise-4.0.0-rc01\conf --home-dir=D:\Databases\Neo4j\Enterprise\neo4j-enterprise-4.0.0-rc01
So this is AdoptOpenJDK 11 as well. I don't have any idea why sun.java.command is missing on your machine. Since it's not an issue affecting all folks on Windows, I'll push a change which fixes the exception and makes sure Neo4j + apoc start up nicely but spit out a warning that apoc.conf couldn't be loaded.
Ok - I managed to recreate the problem on another Windows machine:
Neo4j Community 3.5.14 (with APOC 3.5.0.6) running AdoptOpenJDK 8.0.232.09 -> working just fine
Installed AdoptOpenJDK 11 (over the top)
update the JAVA_HOME path (to use the 11 version)
uninstall neo4j service (3.5.14)
install neo4j service (4.0.0)
Start Neo4j (4.0.0) -> works fine
Add the APOC 4.0 plugin
Seems to me that upgrading from JAVA 8 to JAVA 11 may be the crux of the issue here... I can supply logs from this other machine if that would be at all helpful in validating this problem scenario.
I tried uninstalls/reboots, clearing out JAVA references from the registry/environment variables
I could find nothing that appears to be able to bring back the missing sun.java.command system property when upgrading/replacing JRE/JDK 8 with JDK 11. It seems almost impossible for me to NOT reproduce this problem when upgrading JAVA on Windows.
Cool. Just be aware that you cannot use a apoc.conf file to supply apoc configuration. Instead you need to use either environment variables or system properties. See apoc docs for details.
Thanks Stefan. If anyone else has any ideas on how to "properly" upgrade to JAVA 11 on Windows without loosing the sun.java.command system property I'd love to hear suggestions!
I have the same problem
in log file I message : " system property sun.java.command is not set, assuming '.' as conf dir. This might cause àpoc.conf` not getting loaded "