Hello,
I am trying to run my service with procrun as usual. After migration to
JDK11 I found out, that a connection with jconsole (JMX) is no longer
possible although the arguments for the JVM are the same as before.
After some investigation I found out, I have to explicitly load the
module jdk.management.agent. So I am trying to somewhere get the
--add-modules jdk.management.agent part into the service config. But I
have had no success so far. Adding it to the standard JvmOptions pane
fails with:
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1892) [ 5504] Apache Commons
Daemon procrun log initialized.
[2021-04-16 08:14:49] [info] ( prunsrv.c:1896) [ 5504] Apache Commons
Daemon procrun (1.2.4.0 64-bit) started.
[2021-04-16 08:14:49] [info] ( prunsrv.c:1806) [ 5504] Running Service
'MY_SERVICE'...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1577) [ 164] Inside
ServiceMain...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1032) [ 164]
reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0,
dwWaitHint = 3000, dwServiceSpecificExitCode = 0.
[2021-04-16 08:14:49] [info] ( prunsrv.c:1325) [ 164] Starting service...
[2021-04-16 08:14:49] [debug] ( prunsrv.c:496 ) [ 164] Checking Java
options for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'--add-modules jdk.management.agent' for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-XX:+UseG1GC' for environment variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-Dcom.sun.management.jmxremote.port=9011' for environment variable
requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-Dcom.sun.management.jmxremote.host=localhost' for environment variable
requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-Dcom.sun.management.jmxremote.authenticate=false' for environment
variable requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-Dcom.sun.management.jmxremote.ssl=false' for environment variable
requirements
[2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [ 164] Checking
'-Deu.inform.configDir=C:\.mycomp\myapp\config' for environment variable
requirements
[2021-04-16 08:14:49] [debug] ( javajni.c:216 ) [ 164] Explicit
RuntimeLib specified 'C:\Program
Files\mycomp\mypath\..\java\bin\server\jvm.dll'
[2021-04-16 08:14:49] [debug] ( javajni.c:280 ) [ 164] Adding Java bin
path to the PATH to fix loading of awt.dll: 'C:\Program
Files\mycomp\mypath\..\java\bin'
[2021-04-16 08:14:49] [debug] ( javajni.c:286 ) [ 164] Loading JVM DLL
'C:\Program Files\mycomp\mypath\..\java\bin\server\jvm.dll'
[2021-04-16 08:14:49] [debug] ( javajni.c:414 ) [ 164] Loaded JVM DLL
'C:\Program Files\mycomp\mypath\..\java\bin\server\jvm.dll', home ''.
[2021-04-16 08:14:49] [debug] ( javajni.c:419 ) [ 164]
JNI_GetCreatedJavaVMs...
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[0]
--add-modules jdk.management.agent
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[1]
-XX:+UseG1GC
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[2]
-Dcom.sun.management.jmxremote.port=9011
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[3]
-Dcom.sun.management.jmxremote.host=localhost
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[4]
-Dcom.sun.management.jmxremote.authenticate=false
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[5]
-Dcom.sun.management.jmxremote.ssl=false
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[6]
-Deu.inform.configDir=C:\.mycomp\myapp\config
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[7]
-Djava.class.path=myapp.jar
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[8] exit
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[9] abort
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[10]
-Xms128m
[2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [ 328] Jvm Option[11]
-Xmx819m
[2021-04-16 08:14:49] [error] ( javajni.c:828 ) [ 328] CreateJavaVM
Failed with error [-1]
[2021-04-16 08:14:49] [error] ( javajni.c:828 ) [ 328] The system
cannot find the file specified.
[2021-04-16 08:14:49] [debug] ( javajni.c:1087) [ 328] Java worker
thread finished : with status = 2
[2021-04-16 08:14:49] [error] ( prunsrv.c:1386) [ 164] Failed to start Java
[2021-04-16 08:14:49] [error] ( prunsrv.c:1740) [ 164] ServiceStart
returned 4.
[2021-04-16 08:14:49] [debug] ( prunsrv.c:1032) [ 164]
reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode = 1066,
dwWaitHint = 0, dwServiceSpecificExitCode = 4.
Is this at all possible or do I have a fundamental misunderstanding of
the issue?
Kind regards
Sebastian Götz