[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    Re: [daemon] Java9 --add-modules
From:       Sebastian_Götz <s.goetz () inform-technology ! de>
Date:       2021-04-16 9:32:33
Message-ID: 26e7ef65-1820-eb53-a980-ea28a8edea83 () inform-technology ! de
[Download RAW message or body]

Okay I will try answering my own question:

It turned out, that with my configuration (Windows Server 2019 and Adopt 
OpenJDK 11) I needed to specify an additional argument to make the 
localhost JMX connection work.
This is the complete list of arguments used for the JMX server:

-Dcom.sun.management.jmxremote.port=9011
-Dcom.sun.management.jmxremote.host=localhost
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost

With the additional last parameter it worked as before. So this has 
nothing to do with the initial question.

Btw: --add-modules is used in jlink to create a custom image so I was 
complete out of scope with that.

Kind regards

Am 16.04.2021 um 08:35 schrieb Sebastian Götz:
> 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
>
>


Mit freundlichen Grüßen
iNFORM Technology GmbH

Sebastian Götz

*****************************************************

iNFORM Technology GmbH
Berliner Straße 24
72458 Albstadt-Ebingen

Tel: +49 7431 9816090
s.goetz@inform-technology.de <mailto:s.goetz@inform-technology.de>
http://www.inform-technology.de/ <http://www.inform-technology.de/>

*****************************************************

iNFORM Technology GmbH
Bodenseeallee 18
D-78333 Stockach
Tel: +49 7771 91896-60

*****************************************************

<https://www.facebook.com/informTechnologyGmbH/>

Geschäftsführer: Dipl.-Ing. (FH) Heinz Roth | Handelsregister: HRB 
773712, Amtsgericht Stuttgart | USt-ID Nr.: DE312290945

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den 
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie 
die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient (or have received this e-mail in 
error) please notify the sender immediately and destroy this e-mail. Any 
unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

[Attachment #3 (multipart/related)]

[Attachment #5 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="Calibri">Okay I will try answering my own question:<br>
      <br>
      It turned out, that with my configuration (Windows Server 2019 and
      Adopt OpenJDK 11) I needed to specify an additional argument to
      make the localhost JMX connection work.<br>
      This is the complete list of arguments used for the JMX server:<br>
      <br>
    </font><font face="Calibri"><font face="Calibri"><font
          face="monospace">-Dcom.sun.management.jmxremote.port=9011<br>
          -Dcom.sun.management.jmxremote.host=localhost<br>
          -Dcom.sun.management.jmxremote.authenticate=false<br>
          -Dcom.sun.management.jmxremote.ssl=false<br>
        </font></font></font><font face="Calibri"><font face="Calibri"><font
          face="monospace"><font face="Calibri"><font face="Calibri"><font
                face="monospace">-Djava.rmi.server.hostname=localhost</font></font></font></font></font><br>
  </font><br>
    With the additional last parameter it worked as before. So this has
    nothing to do with the initial question.<br>
    <br>
    Btw: --add-modules is used in jlink to create a custom image so I
    was complete out of scope with that.<br>
    <br>
    Kind regards<br>
    <br>
    <div class="moz-cite-prefix">Am 16.04.2021 um 08:35 schrieb
      Sebastian Götz:<br>
    </div>
    <blockquote type="cite"
      cite="mid:ddbc00ba-3157-3963-22a7-0c93aa3a53c6@inform-technology.de">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <font face="Calibri">Hello,<br>
        <br>
        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:<br>
        <br>
        <font face="monospace">[2021-04-16 08:14:49] [debug] (
          prunsrv.c:1892) [ 5504] Apache Commons Daemon procrun log
          initialized.<br>
          [2021-04-16 08:14:49] [info]  ( prunsrv.c:1896) [ 5504] Apache
          Commons Daemon procrun (1.2.4.0 64-bit) started.<br>
          [2021-04-16 08:14:49] [info]  ( prunsrv.c:1806) [ 5504]
          Running Service 'MY_SERVICE'...<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:1577) [  164] Inside
          ServiceMain...<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:1032) [  164]
          reportServiceStatusE: dwCurrentState = 2, dwWin32ExitCode = 0,
          dwWaitHint = 3000, dwServiceSpecificExitCode = 0.<br>
          [2021-04-16 08:14:49] [info]  ( prunsrv.c:1325) [  164]
          Starting service...<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:496 ) [  164]
          Checking Java options for environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '--add-modules jdk.management.agent' for environment
          variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-XX:+UseG1GC' for environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-Dcom.sun.management.jmxremote.port=9011' for
          environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-Dcom.sun.management.jmxremote.host=localhost' for
          environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-Dcom.sun.management.jmxremote.authenticate=false'
          for environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-Dcom.sun.management.jmxremote.ssl=false' for
          environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:500 ) [  164]
          Checking '-Deu.inform.configDir=C:\.</font></font><font
        face="Calibri"><font face="monospace"><font face="Calibri"><font
              face="monospace">mycomp\myapp</font></font>\config' for
          environment variable requirements<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:216 ) [  164]
          Explicit RuntimeLib specified 'C:\Program Files\</font></font><font
        face="Calibri"><font face="monospace"><font face="Calibri"><font
              face="monospace">mycomp\mypath</font></font>\..\java\bin\server\jvm.dll'<br>
  </font><font face="monospace">[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'<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:286 ) [  164]
          Loading JVM DLL 'C:\Program Files\</font></font><font
        face="Calibri"><font face="monospace"><font face="Calibri"><font
              face="monospace">mycomp\mypath</font></font>\..\java\bin\server\jvm.dll'<br>
  [2021-04-16 08:14:49] [debug] ( javajni.c:414 ) [  164] Loaded
          JVM DLL 'C:\Program Files\</font></font><font face="Calibri"><font
          face="monospace"><font face="Calibri"><font \
face="monospace">mycomp\mypath</font></font>\..\java\bin\server\jvm.dll',  home \
''.<br>  [2021-04-16 08:14:49] [debug] ( javajni.c:419 ) [  164]
          JNI_GetCreatedJavaVMs...<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[0] --add-modules jdk.management.agent<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[1] -XX:+UseG1GC<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[2] -Dcom.sun.management.jmxremote.port=9011<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[3] -Dcom.sun.management.jmxremote.host=localhost<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[4] -Dcom.sun.management.jmxremote.authenticate=false<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[5] -Dcom.sun.management.jmxremote.ssl=false<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[6] -Deu.inform.configDir=C:\.mycomp\myapp\config<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[7] -Djava.class.path=myapp.jar<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[8] exit<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[9] abort<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[10] -Xms128m<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:817 ) [  328] Jvm
          Option[11] -Xmx819m<br>
          [2021-04-16 08:14:49] [error] ( javajni.c:828 ) [  328]
          CreateJavaVM Failed with error [-1]<br>
          [2021-04-16 08:14:49] [error] ( javajni.c:828 ) [  328] The
          system cannot find the file specified.<br>
          [2021-04-16 08:14:49] [debug] ( javajni.c:1087) [  328] Java
          worker thread finished : with status = 2<br>
          [2021-04-16 08:14:49] [error] ( prunsrv.c:1386) [  164] Failed
          to start Java<br>
          [2021-04-16 08:14:49] [error] ( prunsrv.c:1740) [  164]
          ServiceStart returned 4.<br>
          [2021-04-16 08:14:49] [debug] ( prunsrv.c:1032) [  164]
          reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode =
          1066, dwWaitHint = 0, dwServiceSpecificExitCode = 4.</font><br>
        <br>
        <br>
      </font>
      <div class="moz-signature">
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <title></title>
        Is this at all possible or do I have a fundamental
        misunderstanding of the issue?<br>
        <br>
        <div class="moz-signature">Kind regards<br>
          Sebastian Götz<br>
          <br>
          <span style="font-size:0.7em"><br>
          </span></div>
      </div>
    </blockquote>
    <br>
    <div class="moz-signature">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title></title>
      <br>
      <div class="moz-signature">Mit freundlichen Grüßen<br>
        iNFORM Technology GmbH<br>
        <br>
        Sebastian Götz<br>
        <br>
        <span style="font-size:0.9em">
          *****************************************************<br>
          <br>
          iNFORM Technology GmbH<br>
          Berliner Straße 24<br>
          72458 Albstadt-Ebingen<br>
          <br>
          Tel: +49 7431 9816090<br>
          <a href="mailto:s.goetz@inform-technology.de">s.goetz@inform-technology.de</a><br>
                
          <a href="http://www.inform-technology.de/">http://www.inform-technology.de/</a><br>
  <br>
          *****************************************************<br>
          <br>
          iNFORM Technology GmbH<br>
          Bodenseeallee 18<br>
          D-78333 Stockach<br>
          Tel: +49 7771 91896-60<br>
          <br>
          *****************************************************<br>
          <br>
          <a href="https://www.facebook.com/informTechnologyGmbH/"><img
              src="cid:part3.2C2DF1A9.B006D930@inform-technology.de"
              alt="" moz-do-not-send="false" width="308" height="45"
              border="0"></a><br>
          <br>
        </span> <span style="font-size:0.8em"> Geschäftsführer:
          Dipl.-Ing. (FH) Heinz Roth | Handelsregister: HRB 773712,
          Amtsgericht Stuttgart | USt-ID Nr.: DE312290945<br>
        </span> <br>
        <span style="font-size:0.7em"> Diese E-Mail enthält vertrauliche
          und/oder rechtlich geschützte Informationen. Wenn Sie nicht
          der richtige Adressat sind oder diese E-Mail irrtümlich
          erhalten haben, informieren Sie bitte sofort den Absender und
          vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die
          unbefugte Weitergabe dieser Mail ist nicht gestattet.<br>
          <br>
          This e-mail may contain confidential and/or privileged
          information. If you are not the intended recipient (or have
          received this e-mail in error) please notify the sender
          immediately and destroy this e-mail. Any unauthorised copying,
          disclosure or distribution of the material in this e-mail is
          strictly forbidden.<br>
        </span></div>
    </div>
  </body>
</html>


["eahalmbppblclblh.jpg" (image/jpeg)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic