glassfish
  1. glassfish
  2. GLASSFISH-13133

Glassfish 2.1 throws logger exceptions with JAVAAGENT option

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: v2.1.1
    • Fix Version/s: None
    • Component/s: logging
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      13,133
    • Status Whiteboard:
      Hide

      3.1-exclude

      Show
      3.1-exclude

      Description

      HI,

      When I am running an application with -javaagent option in GLASSFISH2.1, few
      conflicts happened and the following exception is thrown in server.log

      I searched in Google and I found that it is a known issue but solution was
      nowhere mentioned.

      One of our high priority customer is facing issues with this problem. Kindly
      let us know if there is any solution/workaround for this problem.

      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.setAgentFeedbackConfigurati
      on(EnterpriseAgent.java:492)
      at com.wily.introscope.agent.enterprise.EnterpriseAgent.loadLogConfiguration
      (EnterpriseAgent.java:454)
      at
      com.wily.introscope.agent.enterprise.EnterpriseAgent.doPostConstructionInitializ
      e(EnterpriseAgent.java:178)
      at
      com.wily.introscope.agent.runtime.java.enterprise.Java2EnterpriseAgent.doPostCon
      structionInitialize(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)

        Activity

        Hide
        sompr04 added a comment -

        Created an attachment (id=4744)
        Server Log

        Show
        sompr04 added a comment - Created an attachment (id=4744) Server Log
        Hide
        tcrane added a comment -
            • Issue 13133 has been confirmed by votes. ***
        Show
        tcrane added a comment - Issue 13133 has been confirmed by votes. ***
        Hide
        naman_mehta added a comment -

        Please provide me the steps to reproduce the same. Is this applicable to GF 3.1
        also?

        Show
        naman_mehta added a comment - Please provide me the steps to reproduce the same. Is this applicable to GF 3.1 also?
        Hide
        sompr04 added a comment -

        Hi Naman,

        We have a javaagent application which has logging as well. When JVM started,
        our agent code runs in very beginning (in premain) and logs some infomration,
        it tries to find com.sun.enterprise.server.logging.ServerLogManager class since
        Glassfish is setting the following system property at startup.
        <sysproperty key="java.util.logging.manager"
        value="com.sun.enterprise.server.logging.ServerLogManager"/>

        According to SUN
        http://download.oracle.com/javase/1.4.2/docs/api/java/util/logging/LogManager.ht
        ml,
        we need to include the LogManager i.e. ServerLogManager class and related
        classes in System Classpath.

        But GlassFish is not including any JARs in system classpath.

        The issue is reproducible only with 1.6 JDK where as in JDK1.5, the issue is
        not reproducible.

        You should be able to reproduce the issue with any JAVAAGENT that does logging
        and in JDK 1.6.

        Thanks
        Pradeep

        Show
        sompr04 added a comment - Hi Naman, We have a javaagent application which has logging as well. When JVM started, our agent code runs in very beginning (in premain) and logs some infomration, it tries to find com.sun.enterprise.server.logging.ServerLogManager class since Glassfish is setting the following system property at startup. <sysproperty key="java.util.logging.manager" value="com.sun.enterprise.server.logging.ServerLogManager"/> According to SUN http://download.oracle.com/javase/1.4.2/docs/api/java/util/logging/LogManager.ht ml, we need to include the LogManager i.e. ServerLogManager class and related classes in System Classpath. But GlassFish is not including any JARs in system classpath. The issue is reproducible only with 1.6 JDK where as in JDK1.5, the issue is not reproducible. You should be able to reproduce the issue with any JAVAAGENT that does logging and in JDK 1.6. Thanks Pradeep
        Hide
        tcrane added a comment -

        Naman,
        When is GlassFish 3.1 going to be released? If it is released where is the link
        to download? The customer is interested in 3.1 if it is released

        Show
        tcrane added a comment - Naman, When is GlassFish 3.1 going to be released? If it is released where is the link to download? The customer is interested in 3.1 if it is released
        Hide
        naman_mehta added a comment -

        If you consider this comment then in 3.1 we don't set any sysproperty for
        logging. The issue is reproducible only with jdk 1.6 not in 1.5. So as per my
        understanding this issue is not related to 3.1. Already it marked as 3.1-exclude.

        I am lowering it's priority to P3 and need to test with v2.

        Show
        naman_mehta added a comment - If you consider this comment then in 3.1 we don't set any sysproperty for logging. The issue is reproducible only with jdk 1.6 not in 1.5. So as per my understanding this issue is not related to 3.1. Already it marked as 3.1-exclude. I am lowering it's priority to P3 and need to test with v2.
        Hide
        naman_mehta added a comment -

        Changing priority to P4 as need to fix in v2.

        Show
        naman_mehta added a comment - Changing priority to P4 as need to fix in v2.

          People

          • Assignee:
            naman_mehta
            Reporter:
            sompr04
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: