WildFly 8.x.x - 10.x.x

With the WildFly version 8 and above there is the problem with the logging when an agent that uses the java.util.logging is started with the WildFly. This problem is filled as the bug on the JBoss issue tracking system. "This is because the java agent does not have access to jboss-logmanager classes, so even if the java.util.logging.manager property is set the classes will not be available." The problem will appear when inspectIT is used as the agent:

java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging
    at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:111)
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:660)
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:501)
    at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:298)
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:293)
    at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:324)
    at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:297)
    at org.jboss.as.server.ServerService.boot(ServerService.java:356)
    at org.jboss.as.server.ServerService.boot(ServerService.java:331)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:259)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS011592: 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.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:103)
    ... 10 more
Caused by: java.lang.IllegalStateException: JBAS011592: 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 org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:122)
    at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:98)
    at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:139)
    at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:125)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:12

This page describes how to set up the WildFly 8.x.x - 10.x.x with the inspectIT agent and overcome the problem.

Configuration

Linux

The configuration is quite simple. Only needed thing is to edit the standalone.conf file (if you start with run standalone.sh start script).

At the beginning of the file add the following line:

# Added for logging problem
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.logmanager,rocks.inspectit"

At the end of the file add the following to solve the logging problem.

# Added for logging problem
JBOSS_HOME="[path-to-jboss-folder]"
JBOSS_LOGMANAGER_VERSION="1.5.2.Final"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-$JBOSS_LOGMANAGER_VERSION.jar"

Above JBOSS_LOGMANAGER_VERSION relates to WildFly version 8.2.1-FINAL. If you are using another WildFly version please make sure that the JBOSS_LOGMANAGER_VERSION is adapted correctly.

At the end of the file we can also integrate the inspectIT related options:

# inspectIT Settings
INSPECTIT_AGENT_HOME="[path-to-inspectit-agent-home]"
INSPECTIT_ADRESS="[IP]:[PORT]"
INSPECTIT_AGENT_NAME="[agent-name]"
INSPECTIT_JAVA_OPTS="-Xbootclasspath/p:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -javaagent:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -Dinspectit.repository=${INSPECTIT_ADRESS} -Dinspectit.agent.name=${INSPECTIT_AGENT_NAME}"
JAVA_OPTS="${INSPECTIT_JAVA_OPTS} ${JAVA_OPTS}"


Windows

The configuration is quite simple. Only needed thing is to edit the standalone.conf.bat file (if you start with run standalone.sh start script).


Find the following line

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman"

Replace this line with the following:

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,rocks.inspectit.agent.java"

At the end of the file add the following to solve the logging problem.

# Added for logging problem
set "JBOSS_HOME=[path-to-jboss-folder]"
set "JBOSS_LOGMANAGER_VERSION=1.5.2.Final"
set "JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:%JBOSS_HOME%/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-%JBOSS_LOGMANAGER_VERSION%.jar"

Above JBOSS_LOGMANAGER_VERSION relates to WildFly version 8.2.1-FINAL. If you are using another WildFly version please make sure that the JBOSS_LOGMANAGER_VERSION is adapted correctly.

At the end of the file we can also integrate the inspectIT related options:

# inspectIT Settings
set "INSPECTIT_AGENT_HOME=[path-to-inspectit-agent-home]"
set "INSPECTIT_ADRESS=[IP]:[PORT]"
set "INSPECTIT_AGENT_NAME=[agent-name]"
set "INSPECTIT_JAVA_OPTS=-Xbootclasspath/p:%INSPECTIT_AGENT_HOME%/inspectit-agent.jar -javaagent:%INSPECTIT_AGENT_HOME%/inspectit-agent.jar -Dinspectit.repository=%INSPECTIT_ADRESS% -Dinspectit.agent.name=%INSPECTIT_AGENT_NAME%"
JAVA_OPTS="${INSPECTIT_JAVA_OPTS} ${JAVA_OPTS}"

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman