Receiving log4j/LogManager class load errors when attempting to instrument JVM

Document ID : KB000117052
Last Modified Date : 05/10/2018
Show Technical Document Details
Question:
We are using APM Agent 10.5.2.52 with an "other Java Application".

When we have Agent.jar and the profile called in JAVA_OPTS in a location that allows for metrics collection, the application is receiving a LogManager could not load class error. When APM is removed from startup, the application (PingAccess) is able to launch without the log4j LogManager errors. Starting PingAccess Could not load Logmanager "org.apache.logging.log4j.jul.LogManager" java.lang.ClassNotFoundException: org.apache.logging.log4j.jul.LogManager at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.util.logging.LogManager$1.run(LogManager.java:195) at java.util.logging.LogManager$1.run(LogManager.java:181) at java.security.AccessController.doPrivileged(Native Method) at java.util.logging.LogManager.(LogManager.java:181) at java.util.logging.Logger.demandLogger(Logger.java:448) at java.util.logging.Logger.getLogger(Logger.java:502) at com.google.common.cache.CacheBuilder.(CacheBuilder.java:213) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointCandidateFinder.(ExitPointCandidateFinder.java:33) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointCandidateFinder.(ExitPointCandidateFinder.java:46) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointCandidateFinder$SingletonHolder.(ExitPointCandidateFinder.java:153) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointCandidateFinder.getInstance(ExitPointCandidateFinder.java:149) at com.wily.introscope.agent.intelligent.exitpoint.stacktrace.ThreadSelector.(ThreadSelector.java:22) at com.wily.introscope.agent.intelligent.exitpoint.stacktrace.ExitPointStackTraceRecorder.(ExitPointStackTraceRecorder.java:26) at com.wily.introscope.agent.intelligent.detection.StackTraceRecorder.(StackTraceRecorder.java:26) at com.wily.introscope.agent.intelligent.detection.StackTraceRecorder.(StackTraceRecorder.java:28) at com.wily.introscope.agent.intelligent.detection.StackTraceRecorder$SingletonHolder.(StackTraceRecorder.java:70) at com.wily.introscope.agent.intelligent.detection.StackTraceRecorder.getInstance(StackTraceRecorder.java:66) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointDetectionConfiguration$3.set(ExitPointDetectionConfiguration.java:146) at com.wily.util.properties.hot.ConfigurationProperty.setValue(ConfigurationProperty.java:635) at com.wily.util.properties.hot.ConfigurationProperty.setValueAndLog(ConfigurationProperty.java:593) at com.wily.util.properties.hot.ConfigurationManager.add(ConfigurationManager.java:128) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointDetectionConfiguration.initializeStackTraceRecordingsLimitPerThread(ExitPointDetectionConfiguration.java:151) at com.wily.introscope.agent.intelligent.exitpoint.ExitPointDetectionConfiguration.init(ExitPointDetectionConfiguration.java:66) at com.wily.introscope.agent.intelligent.detection.AutomaticBoundaryDetectionService.doStartService(AutomaticBoundaryDetectionService.java:53) at com.wily.introscope.agent.service.ASimpleService.IAgentService_startService(ASimpleService.java:39) at com.wily.introscope.agent.service.ServiceAdministrator$ServiceInitializer.startService(ServiceAdministrator.java:604) at com.wily.introscope.agent.service.ServiceAdministrator$ServiceInitializer.startServiceSafe(ServiceAdministrator.java:618) at com.wily.introscope.agent.service.ServiceAdministrator$ServiceInitializer.IExecutableItem_execute(ServiceAdministrator.java:482) at com.wily.util.task.AsynchExecutionQueue$WrapperItem.IExecutableItem_execute(AsynchExecutionQueue.java:414) at com.wily.util.task.AsynchExecutionQueue.doTask(AsynchExecutionQueue.java:205) at com.wily.util.task.ATask$CoreTask.run(ATask.java:132) at java.lang.Thread.run(Thread.java:748) Operational Mode: CLUSTERED_ENGINE PingAccess running…
Answer:
APM Java Agent does not explicitly support working with Pingaccess. 
If you proceed setting this up anyway, things to test/temporarily disable to troubleshoot.
1) Turning autoprobe off
2) Haing autoprobe on but disabling various Introscope tracers/features

introscope.agent.sockets.reportRateMetrics=false
introscope.agent.deep.instrumentation.enabled=false
introscope.agent.deep.trace.enabled=false 

introscope.agent.deep.errorsnapshot.enable=false
introscope.agent.gcmonitor.enable=false
introscope.agent.bizRecording.enabled=false

3)  Also try  changing in the IntroscopeAgent.profile
com.wily.log4j.defaultInitOverride=false
log4j.logger.IntroscopeAgent=OFF



 
Additional Information:
You may also test to another Logger Manager.. Also check if the dependencies are correct.

https://logging.apache.org/log4j/2.0/runtime-dependencies.html

https://logging.apache.org/log4j/2.0/log4j-jul/index.html