Troubleshooting Java agent installation errors in JBoss

After adding Javaagent in JBoss, server does not start. It throws JBoss logger exception. How do I resolve it?

After configuring the APM Java agent with a JBoss EAP, JBoss AS, or WildFly application server, the server may fail to start with a LogManager-related exception.

You may encounter one of the following errors.

WildFly and newer JBoss EAP versions
java.lang.IllegalStateException: The LogManager was not properly installed
(you must set the "java.util.logging.manager" system property to
"org.jboss.logmanager.LogManager")
Older JBoss AS/EAP versions
java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log
manager to be org.jboss.logmanager.LogManager. The subsystem has not been 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"

Cause

The APM Java agent's premain() method runs before the application server starts. During agent initialization, if the JVM's java.util.logging framework is initialized before JBoss or WildFly installs its own LogManager, the JVM permanently locks in the default LogManager implementation.

When the application server later verifies that the JBoss LogManager is installed, it detects the wrong implementation and terminates the startup process.

Because this behavior depends on startup timing, network conditions, and system load, the issue may occur intermittently rather than on every server startup.

Resolution

Configure the required JVM options before starting the application server.

  • If you are running in standalone mode, add the properties to standalone.conf.
  • If you are running in domain mode, add the properties to host.xml.

Step 1: Configure the JBoss LogManager

Add the following system property:

-Djava.util.logging.manager=org.jboss.logmanager.LogManager

Step 2: Expose the LogManager package to JBoss Modules

Update the jboss.modules.system.pkgs property to include the JBoss LogManager package.

Notes
Retain any existing values in this property. Append the new package instead of replacing the current entries.

-Djboss.modules.system.pkgs=org.jboss.byteman,com.manageengine,org.jboss.logmanager

Step 3: Add the JBoss LogManager JAR to the bootstrap classpath

Append the JBoss LogManager JAR using the following JVM option:

-Xbootclasspath/a:<JBOSS_HOME>/<path_to_jboss-logmanager_jar>/jboss-logmanager-<version>.jar

Replace <JBOSS_HOME>, <path_to_jboss-logmanager_jar>, and <version> with the appropriate values for your installation.

Step 4: Disable the caller-class check (JDK 9 and later)

If you are using JDK 9 or later, add the following JVM option:

-Dsun.util.logging.disableCallerCheck=true

Restart the server

After applying the above changes, restart the JBoss or WildFly server for the configuration to take effect.

Summary

This issue occurs because the JVM initializes the default Java LogManager before JBoss or WildFly installs its own logging implementation. Configuring the required JVM properties ensures that the correct JBoss LogManager is loaded during startup, allowing the application server and the APM Java agent to coexist without startup failures.