Running wildfly-30.0.1.Final with custom VM args

164 views
Skip to first unread message

Iason Filippou

unread,
Jan 22, 2024, 8:27:03 AM1/22/24
to wil...@googlegroups.com
Hello,

I have downloaded wildfly-30.0.1.Final from source and when I run the standalone.bat the server comes up just fine on localhost. However, I have a use case where I need to add the following JVM argos when running the server:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=1990


So I went to the standalone.bat to see where the `java` executable is called, found it:

:RESTART
  "%JAVA%" %JAVA_OPTS% ^
   "-Dorg.jboss.boot.log.file=%JBOSS_LOG_DIR%\server.log" ^
   "-Dlogging.configuration=file:%JBOSS_CONFIG_DIR%/logging.properties" ^
      -jar "%JBOSS_HOME%\jboss-modules.jar" ^
      %MODULE_OPTS% ^
      -mp "%JBOSS_MODULEPATH%" ^
      org.jboss.as.standalone ^
      "-Djboss.home.dir=%JBOSS_HOME%" ^
      %SERVER_OPTS%


Then added my VM args respecting the syntax of the file:

:RESTART
  "%JAVA%" %JAVA_OPTS% ^
   "-Dorg.jboss.boot.log.file=%JBOSS_LOG_DIR%\server.log" ^
   "-Dlogging.configuration=file:%JBOSS_CONFIG_DIR%/logging.properties" ^
"-Dcom.sun.management.jmxremote" ^
"-Dcom.sun.management.jmxremote.authenticate=false" ^
"-Dcom.sun.management.jmxremote.ssl=false" ^
"-Dcom.sun.management.jmxremote.port=1990" ^
      -jar "%JBOSS_HOME%\jboss-modules.jar" ^
      %MODULE_OPTS% ^
      -mp "%JBOSS_MODULEPATH%" ^
      org.jboss.as.standalone ^
      "-Djboss.home.dir=%JBOSS_HOME%" ^
      %SERVER_OPTS%


But then the server fails to come up mentioning some issue with the logging driver:

ERROR: WFLYCTL0013: Operation ("parallel-extension-add") failed - address: ([])
java.lang.RuntimeException: WFLYCTL0079: Failed initializing module org.jboss.as.logging
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:98)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1048)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:769)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:460)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1433)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:506)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:443)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:414)
        at org.jboss...@22.0.2.Final//org.jboss.as.server.ServerService.boot(ServerService.java:451)
        at org.jboss...@22.0.2.Final//org.jboss.as.server.ServerService.boot(ServerService.java:393)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:353)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: WFLYLOG0078: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at org.jboss.a...@22.0.2.Final//org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:90)
        ... 11 more


Some googling got me here: https://support.contrastsecurity.com/hc/en-us/articles/4402378090900-ERROR-The-logging-subsystem-requires-the-log-manager-to-be-org-jboss-logmanager-LogManager-

So I added the following VM args:

"-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager" ^
"-Djava.util.logging.manager=org.jboss.logmanager.LogManager" ^
"-Xbootclasspath/a:C:\XMProjects\wildfly-30.0.1.Final\modules\system\layers\base\org\jboss\logmanager\main\jboss-logmanager-2.1.19.Final.jar" ^


which gave me this upon server startup: 

java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
        at org.jboss.logmanager.Logger.getLogger(Logger.java:57)
        at org.jboss...@22.0.2.Final//org.jboss.as.server.Main.main(Main.java:72)
        at org.jboss.modules.Module.run(Module.java:352)
        at org.jboss.modules.Module.run(Module.java:320)
        at org.jboss.modules.Main.main(Main.java:607)


But this is weird, am I not explicitly settting the logging manager to org.jboss.logmanager.LogManager and providing the .jars?

Appreciate any help,

Jason

James Perkins

unread,
Jan 25, 2024, 4:21:25 PM1/25/24
to WildFly
It's really best to use the jmx subsystem to configure JMX. I don't know this for sure, but my guess would be when using those properties JMX configures a logger before the log manager is set.

I would not advise add the log manager to the boot class path as it's rather fragile if you're environment ever changes. There's also more than just the log manager you need to add to the boot class path.

Reply all
Reply to author
Forward
0 new messages