Neo4j service did not start (windows)

Hi.

I've been using neo4j 3.5.7 as windows service. But time for upgrade came and I've unpacked new version 4.1.3 (to different directory), uninstalled old service and installed new with "neo4j uninstall-service" and "neo4j install-service". But when I try to start service it failed.

Here is output:

C:\app\neo4j-community-4.1.3\bin>neo4j start -verbose
VERBOSE: Neo4j Root is 'C:\app\neo4j-community-4.1.3'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '4.1.3'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Start command specified
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Java detected at 'C:\Program Files\Java\jdk-11.0.6\bin\java.exe'
VERBOSE: Invoking "C:\Program Files\Java\jdk-11.0.6\bin\java.exe" -version 2>&1
VERBOSE: Command returned with exit code 0
VERBOSE: Java version response: java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
VERBOSE: Java Version detected as 11.0.6
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Starting Neo4j as a service
VERBOSE: Invoking C:\app\neo4j-community-4.1.3\bin\tools\prunsrv-amd64.exe "//ES//neo4j" 2>&1
VERBOSE: Command returned with exit code 5
Neo4j service did not start

I'm using Win 10 Enterprise. And of course I've tried restart my PC

Also here is a console from installing service:

C:\app\neo4j-community-4.1.3\bin>neo4j install-service -verbose
VERBOSE: Neo4j Root is 'C:\app\neo4j-community-4.1.3'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '4.1.3'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Install command specified
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Java detected at 'C:\Program Files\Java\jdk-11.0.6\bin\java.exe'
VERBOSE: Invoking "C:\Program Files\Java\jdk-11.0.6\bin\java.exe" -version 2>&1
VERBOSE: Command returned with exit code 0
VERBOSE: Java version response: java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
VERBOSE: Java Version detected as 11.0.6
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Reading JVM settings from configuration
VERBOSE: Adding '-XX:+UseG1GC'
VERBOSE: Adding '-XX:-OmitStackTraceInFastThrow'
VERBOSE: Adding '-XX:+AlwaysPreTouch'
VERBOSE: Adding '-XX:+UnlockExperimentalVMOptions'
VERBOSE: Adding '-XX:+TrustFinalNonStaticFields'
VERBOSE: Adding '-XX:+DisableExplicitGC'
VERBOSE: Adding '-XX:MaxInlineLevel=15'
VERBOSE: Adding '-Djdk.nio.maxCachedBufferSize=262144'
VERBOSE: Adding '-Dio.netty.tryReflectionSetAccessible=true'
VERBOSE: Adding '-Djdk.tls.ephemeralDHKeySize=2048'
VERBOSE: Adding '-Djdk.tls.rejectClientInitiatedRenegotiation=true'
VERBOSE: Adding '-XX:FlightRecorderOptions=stackdepth=256'
VERBOSE: Adding '-XX:+UnlockDiagnosticVMOptions'
VERBOSE: Adding '-XX:+DebugNonSafepoints'
VERBOSE: Moving -XX:+UnlockExperimentalVMOptions to the beginning
VERBOSE: Reading JVM settings from console java invocation
VERBOSE: Merging '-XX:+UseG1GC'
VERBOSE: Merging '-XX:-OmitStackTraceInFastThrow'
VERBOSE: Merging '-XX:+AlwaysPreTouch'
VERBOSE: Merging '-XX:+UnlockExperimentalVMOptions'
VERBOSE: Merging '-XX:+TrustFinalNonStaticFields'
VERBOSE: Merging '-XX:+DisableExplicitGC'
VERBOSE: Merging '-XX:MaxInlineLevel=15'
VERBOSE: Merging '-Djdk.nio.maxCachedBufferSize=262144'
VERBOSE: Merging '-Dio.netty.tryReflectionSetAccessible=true'
VERBOSE: Merging '-Djdk.tls.ephemeralDHKeySize=2048'
VERBOSE: Merging '-Djdk.tls.rejectClientInitiatedRenegotiation=true'
VERBOSE: Merging '-XX:FlightRecorderOptions=stackdepth=256'
VERBOSE: Merging '-XX:+UnlockDiagnosticVMOptions'
VERBOSE: Merging '-XX:+DebugNonSafepoints'
VERBOSE: Adding '-Dfile.encoding=UTF-8'
VERBOSE: Moving -XX:+UnlockExperimentalVMOptions to the beginning
VERBOSE: Installing Neo4j as a service
VERBOSE: Invoking C:\app\neo4j-community-4.1.3\bin\tools\prunsrv-amd64.exe "//IS//neo4j" "--StartMode=jvm"
"--StartMethod=start" "--ServiceUser=LocalSystem" "--StartPath=C:\app\neo4j-community-4.1.3"
"--StartParams=--config-dir=C:\app\neo4j-community-4.1.3\conf" "++StartParams=--home-dir=C:\app\neo4j-community-4.1.3"
"--StopMode=jvm" "--StopMethod=stop" "--StopPath=C:\app\neo4j-community-4.1.3" "--Description=Neo4j Graph Database -
C:\app\neo4j-community-4.1.3" "--DisplayName=Neo4j Graph Database - neo4j" "--Jvm=C:\Program
Files\Java\jdk-11.0.6\bin\server\jvm.dll" "--LogPath=C:\app\neo4j-community-4.1.3\logs"
"--StdOutput=C:\app\neo4j-community-4.1.3\logs\neo4j.log"
"--StdError=C:\app\neo4j-community-4.1.3\logs\service-error.log" "--LogPrefix=neo4j-service"
"--Classpath=lib/*;plugins/*"
"--JvmOptions=-XX:+UnlockExperimentalVMOptions;-Djdk.tls.rejectClientInitiatedRenegotiation=true;-XX:+DebugNonSafepoint
s;-XX:+AlwaysPreTouch;-XX:+TrustFinalNonStaticFields;-XX:+UseG1GC;-Djdk.nio.maxCachedBufferSize=262144;-XX:FlightRecord
erOptions=stackdepth=256;-XX:+UnlockDiagnosticVMOptions;-Djdk.tls.ephemeralDHKeySize=2048;-Dio.netty.tryReflectionSetAc
cessible=true;-XX:-OmitStackTraceInFastThrow;-XX:+DisableExplicitGC;-XX:MaxInlineLevel=15;-Dfile.encoding=UTF-8"
"--Startup=auto" "--StopClass=org.neo4j.server.CommunityEntryPoint" "--StartClass=org.neo4j.server.CommunityEntryPoint"
 2>&1
VERBOSE: Command returned with exit code 0
Neo4j service installed

Same problem here 4.3.18 not starting, 4.4.11 community not starting, 4.4.11 enterprise not starting.

openjdk 11.0.16.1 2022-08-12 LTS
OpenJDK Runtime Environment Microsoft-40648 (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM Microsoft-40648 (build 11.0.16.1+1-LTS, mixed mode)

Starting Neo4j.
WARNING! You are using an unsupported Java runtime.
* Please use Oracle(R) Java(TM) 11, OpenJDK(TM) 11 to run Neo4j.
* Please see https://neo4j.com/docs/ for Neo4j installation instructions.
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option UseBiasedLocking; support was removed in 18.0
2022-09-12 11:10:45.805+0000 INFO Starting...
Exception in thread "main" java.lang.LinkageError: Cannot to link java.nio.DirectByteBuffer
at org.neo4j.internal.unsafe.UnsafeUtil.(UnsafeUtil.java:128)
at org.neo4j.memory.RuntimeInternals.guessHeaderSize(RuntimeInternals.java:158)
at org.neo4j.memory.RuntimeInternals.(RuntimeInternals.java:53)
at org.neo4j.memory.HeapEstimator.(HeapEstimator.java:103)
at org.neo4j.internal.collector.RecentQueryBuffer.(RecentQueryBuffer.java:37)
at org.neo4j.graphdb.factory.module.GlobalModule.(GlobalModule.java:212)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.createGlobalModule(DatabaseManagementServiceFactory.java:272)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:133)
at com.neo4j.server.enterprise.EnterpriseManagementServiceFactory.createManagementService(EnterpriseManagementServiceFactory.java:38)
at com.neo4j.server.enterprise.EnterpriseBootstrapper.createNeo(EnterpriseBootstrapper.java:20)
at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:142)
at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:95)
at com.neo4j.server.enterprise.EnterpriseEntryPoint.main(EnterpriseEntryPoint.java:24)
Caused by: java.lang.IllegalAccessException: module java.base does not open java.nio to unnamed module @618b19ad
at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:263)
at org.neo4j.internal.unsafe.UnsafeUtil.(UnsafeUtil.java:111)
... 12 more
2022-09-12 11:10:45.914+0000 INFO Neo4j Server shutdown initiated by request
2022-09-12 11:10:45.914+0000 INFO Stopped.
Unexpected process failure.


@stefanak_michal wrote:

Hi.

I've been using neo4j 3.5.7 as windows service. But time for upgrade came and I've unpacked new version 4.1.3 (to different directory), uninstalled old service and installed new with "neo4j uninstall-service" and "neo4j install-service". But when I try to start service it failed.

Here is output:

C:\app\neo4j-community-4.1.3\bin>neo4j start -verbose
VERBOSE: Neo4j Root is 'C:\app\neo4j-community-4.1.3'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '4.1.3'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Start command specified
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Java detected at 'C:\Program Files\Java\jdk-11.0.6\bin\java.exe'
VERBOSE: Invoking "C:\Program Files\Java\jdk-11.0.6\bin\java.exe" -version 2>&1
VERBOSE: Command returned with exit code 0
VERBOSE: Java version response: java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
VERBOSE: Java Version detected as 11.0.6
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Starting Neo4j as a service
VERBOSE: Invoking C:\app\neo4j-community-4.1.3\bin\tools\prunsrv-amd64.exe "//ES//neo4j" 2>&1
VERBOSE: Command returned with exit code 5
Neo4j service did not start

I'm using Win 10 Enterprise. And of course I've tried restart my PC

Also here is a console from installing service:

C:\app\neo4j-community-4.1.3\bin>neo4j install-service -verbose
VERBOSE: Neo4j Root is 'C:\app\neo4j-community-4.1.3'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '4.1.3'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Install command specified
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Java detected at 'C:\Program Files\Java\jdk-11.0.6\bin\java.exe'
VERBOSE: Invoking "C:\Program Files\Java\jdk-11.0.6\bin\java.exe" -version 2>&1
VERBOSE: Command returned with exit code 0
VERBOSE: Java version response: java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
VERBOSE: Java Version detected as 11.0.6
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Reading JVM settings from configuration
VERBOSE: Adding '-XX:+UseG1GC'
VERBOSE: Adding '-XX:-OmitStackTraceInFastThrow'
VERBOSE: Adding '-XX:+AlwaysPreTouch'
VERBOSE: Adding '-XX:+UnlockExperimentalVMOptions'
VERBOSE: Adding '-XX:+TrustFinalNonStaticFields'
VERBOSE: Adding '-XX:+DisableExplicitGC'
VERBOSE: Adding '-XX:MaxInlineLevel=15'
VERBOSE: Adding '-Djdk.nio.maxCachedBufferSize=262144'
VERBOSE: Adding '-Dio.netty.tryReflectionSetAccessible=true'
VERBOSE: Adding '-Djdk.tls.ephemeralDHKeySize=2048'
VERBOSE: Adding '-Djdk.tls.rejectClientInitiatedRenegotiation=true'
VERBOSE: Adding '-XX:FlightRecorderOptions=stackdepth=256'
VERBOSE: Adding '-XX:+UnlockDiagnosticVMOptions'
VERBOSE: Adding '-XX:+DebugNonSafepoints'
VERBOSE: Moving -XX:+UnlockExperimentalVMOptions to the beginning
VERBOSE: Reading JVM settings from console java invocation
VERBOSE: Merging '-XX:+UseG1GC'
VERBOSE: Merging '-XX:-OmitStackTraceInFastThrow'
VERBOSE: Merging '-XX:+AlwaysPreTouch'
VERBOSE: Merging '-XX:+UnlockExperimentalVMOptions'
VERBOSE: Merging '-XX:+TrustFinalNonStaticFields'
VERBOSE: Merging '-XX:+DisableExplicitGC'
VERBOSE: Merging '-XX:MaxInlineLevel=15'
VERBOSE: Merging '-Djdk.nio.maxCachedBufferSize=262144'
VERBOSE: Merging '-Dio.netty.tryReflectionSetAccessible=true'
VERBOSE: Merging '-Djdk.tls.ephemeralDHKeySize=2048'
VERBOSE: Merging '-Djdk.tls.rejectClientInitiatedRenegotiation=true'
VERBOSE: Merging '-XX:FlightRecorderOptions=stackdepth=256'
VERBOSE: Merging '-XX:+UnlockDiagnosticVMOptions'
VERBOSE: Merging '-XX:+DebugNonSafepoints'
VERBOSE: Adding '-Dfile.encoding=UTF-8'
VERBOSE: Moving -XX:+UnlockExperimentalVMOptions to the beginning
VERBOSE: Installing Neo4j as a service
VERBOSE: Invoking C:\app\neo4j-community-4.1.3\bin\tools\prunsrv-amd64.exe "//IS//neo4j" "--StartMode=jvm"
"--StartMethod=start" "--ServiceUser=LocalSystem" "--StartPath=C:\app\neo4j-community-4.1.3"
"--StartParams=--config-dir=C:\app\neo4j-community-4.1.3\conf" "++StartParams=--home-dir=C:\app\neo4j-community-4.1.3"
"--StopMode=jvm" "--StopMethod=stop" "--StopPath=C:\app\neo4j-community-4.1.3" "--Description=Neo4j Graph Database -
C:\app\neo4j-community-4.1.3" "--DisplayName=Neo4j Graph Database - neo4j" "--Jvm=C:\Program
Files\Java\jdk-11.0.6\bin\server\jvm.dll" "--LogPath=C:\app\neo4j-community-4.1.3\logs"
"--StdOutput=C:\app\neo4j-community-4.1.3\logs\neo4j.log"
"--StdError=C:\app\neo4j-community-4.1.3\logs\service-error.log" "--LogPrefix=neo4j-service"
"--Classpath=lib/*;plugins/*"
"--JvmOptions=-XX:+UnlockExperimentalVMOptions;-Djdk.tls.rejectClientInitiatedRenegotiation=true;-XX:+DebugNonSafepoint
s;-XX:+AlwaysPreTouch;-XX:+TrustFinalNonStaticFields;-XX:+UseG1GC;-Djdk.nio.maxCachedBufferSize=262144;-XX:FlightRecord
erOptions=stackdepth=256;-XX:+UnlockDiagnosticVMOptions;-Djdk.tls.ephemeralDHKeySize=2048;-Dio.netty.tryReflectionSetAc
cessible=true;-XX:-OmitStackTraceInFastThrow;-XX:+DisableExplicitGC;-XX:MaxInlineLevel=15;-Dfile.encoding=UTF-8"
"--Startup=auto" "--StopClass=org.neo4j.server.CommunityEntryPoint" "--StartClass=org.neo4j.server.CommunityEntryPoint"
 2>&1
VERBOSE: Command returned with exit code 0
Neo4j service installed

For Neo4j 520, I had the same issue. This is how it worked for me.

1. Install JDK 17

2. C:\neo4j520\bin>neo4j windows-service install
Neo4j service installed.