Glassfish 2.1 Introscope conflicts with logger.

Document ID : KB000030155
Last Modified Date : 14/02/2018
Show Technical Document Details

Description: 

This happens with any version of Introscope Agent with the following setup:


Application Server : Glass Fish 2.1
OS :  Happens in all OS (Wind/ Linux/Mac)
Java :  JVM Version  jdk1.6.0_16

After adding the APM agent on the Application Server, the server starts with these exceptions:

Could not load Logmanager "com.sun.enterprise.server.logging.ServerLogManager"
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.util.logging.LogManager$1.run(LogManager.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:158)
at java.util.logging.Logger.getLogger(Logger.java:273)
at sun.awt.AppContext.<clinit>(AppContext.java:114)
at java.beans.Introspector.getBeanInfo(Introspector.java:157)
at com.wily.org.apache.log4j.config.PropertySetter.introspect(PropertySetter.java:66)
at com.wily.org.apache.log4j.config.PropertySetter.getPropertyDescriptor(PropertySetter.java:234)
at com.wily.org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:146)
at com.wily.org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:120)
at com.wily.org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
at com.wily.org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:640)
at com.wily.org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
at com.wily.org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:524)
at com.wily.org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:408)
at com.wily.org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:340)
at com.wily.util.feedback.backend.log4j.Log4JBackend.configureFromProperties(Log4JBackend.java:97)
at com.wily.util.feedback.WilyLog4JConfigureAndWatchHelper.onChange(WilyLog4JConfigureAndWatchHelper.java:62)
at com.wily.util.ConfigurationWatcher.addConfigurationListener(ConfigurationWatcher.java:147)
at com.wily.util.feedback.AsynchFeedbackChannel.setConfiguration(AsynchFeedbackChannel.java:66)
at com.wily.util.feedback.CachingDelegatingFeedbackChannel.setConfiguration(CachingDelegatingFeedbackChannel.java:212)
at com.wily.introscope.agent.enterprise.EnterpriseAgent.setAgentFeedbackConfiguration(EnterpriseAgent.java:492)
at com.wily.introscope.agent.enterprise.EnterpriseAgent.loadLogConfiguration(EnterpriseAgent.java:454)
at com.wily.introscope.agent.enterprise.EnterpriseAgent.doPostConstructionInitialize(EnterpriseAgent.java:178)
at com.wily.introscope.agent.runtime.java.enterprise.Java2EnterpriseAgent.doPostConstructionInitialize(Java2EnterpriseAgent.java:37)
at com.wily.introscope.agent.ACommonAgent.postConstructionInitialize(ACommonAgent.java:378)
at com.wily.introscope.agent.AgentShim.doCreateDelegate(AgentShim.java:594)
at com.wily.introscope.agent.AgentShim.createDelegate(AgentShim.java:503)
at com.wily.introscope.agent.AgentShim.getDelegateAgent(AgentShim.java:473)
at com.wily.introscope.agent.AgentShim.ProbeBuilderEntryPoint_initializeAgentShim(AgentShim.java:715)
at com.wily.introscope.api.instrument.JavaAgent.premain(JavaAgent.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)

On absence of the Agent, these errors are not seen.

Solution:

The issue is with Glassfish product. For more information refer to:

https://java.net/jira/browse/GLASSFISH-6164

It is highly recommended to upgrade to Glassfish 3.x without applying any workaround. This is because the logger issues are fixed with that version.