JBoss 7.x

With the JBoss version 6 and above there is the problem with the logging when an agent that uses the java.util.logging is started with the JBoss. This problem is filled as the bug on the JBoss issue trakcing 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:

WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logmanager/Level
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at org.jboss.modules.Module.run(Module.java:247)
	at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Level
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:395)
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
	... 4 more
Jul 11, 2013 4:53:00 PM info.novatec.inspectit.agent.core.impl.CoreService$ShutdownHookSender run
INFO: Shutdown initialized, sending remaining data
Jul 11, 2013 4:53:00 PM info.novatec.inspectit.agent.core.impl.CoreService$PlatformSensorRefresher run
SEVERE: Platform sensor refresher was interrupted!
Jul 11, 2013 4:53:00 PM info.novatec.inspectit.agent.core.impl.CoreService$SendingThread run
SEVERE: Sending thread interrupted and shuting down!
Jul 11, 2013 4:53:00 PM info.novatec.inspectit.agent.core.impl.CoreService$PreparingThread run
SEVERE: Preparing thread interrupted and shuting down!

This page describes how to set up the JBoss 7.x with the inspectIT agent and overcome the problem.

Configuration

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

At the begging of the file add the following line:

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

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

# Added for logging problem
JBOSS_HOME="[path-to-jboss-folder]"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar -Xbootclasspath/p:$JBOSS_HOME/modules/org/apache/log4j/main/log4j-1.2.16.jar"

Above paths to JAR files relate to JBoss version 7.1.1. If you are using the older version please make sure that the paths to JARs are correct.

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_CONFIG_HOME="[path-to-config-folder]"
INSPECTIT_JAVA_OPTS="-Xbootclasspath/p:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -javaagent:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -Dinspectit.config=${INSPECTIT_CONFIG_HOME}"
JAVA_OPTS="${INSPECTIT_JAVA_OPTS} ${JAVA_OPTS}"