Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem with JBoss Logging

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 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:

...

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

Problem with Custom Logging Module

If a custom logging module is used with JBoss 6.x, JBoss throws the following exception at startup with the inspectIT agent:

Code Block
java.lang.IllegalArgumentException: Failed to load module "de.myLoggingModule.logging" for handler "CUSTOM_HANDLER"
	at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:64)
	at org.jboss.logmanager.config.HandlerConfigurationImpl.<init>(HandlerConfigurationImpl.java:51)
	at org.jboss.logmanager.config.LogContextConfigurationImpl.addHandlerConfiguration(LogContextConfigurationImpl.java:142)
	at org.jboss.logmanager.PropertyConfigurator.configureHandler(PropertyConfigurator.java:666)
	at org.jboss.logmanager.PropertyConfigurator.configureLogger(PropertyConfigurator.java:576)
	at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:514)
	at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:94)
	at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:493)
	at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:455)
	at java.util.logging.LogManager$3.run(LogManager.java:399)
	at java.util.logging.LogManager$3.run(LogManager.java:396)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
	at java.util.logging.LogManager.access$800(LogManager.java:145)
	at java.util.logging.LogManager$2.run(LogManager.java:345)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
	at java.util.logging.LogManager.getLogManager(LogManager.java:378)
	at java.util.logging.Logger.demandLogger(Logger.java:448)
	at java.util.logging.Logger.getLogger(Logger.java:502)
	at rocks.inspectit.agent.java.javaagent.JavaAgent.<clinit>(JavaAgent.java:53)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
	at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.NoClassDefFoundError: org/jboss/modules/ModuleLoader
	at org.jboss.logmanager.config.AbstractPropertyConfiguration$ModuleFinder.getClassLoader(AbstractPropertyConfiguration.java:463)
	at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:62)
	... 26 more

Add the following configuration to the JAVA_OPTS to solve this problem:

Code Block
JAVA_OPTS="$JAVA_OPTS -Dmodule.path=$JBOSS_HOME/jboss-modules.jar"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/jboss-modules.jar"


Configuration

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

...