Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11048

user/custom LogManager fails to load if the client classloader is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.6.0
    • util
    • None
    • Reviewed

    Description

      If the client classloader is enabled (HADOOP-10893) and you happen to use a user-provided log manager via -Djava.util.logging.manager, it fails to load the custom log manager:

      Could not load Logmanager "org.foo.LogManager"
      java.lang.ClassNotFoundException: org.foo.LogManager
          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:425)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
          at java.util.logging.LogManager$1.run(LogManager.java:191)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.util.logging.LogManager.<clinit>(LogManager.java:181)
          at java.util.logging.Logger.demandLogger(Logger.java:339)
          at java.util.logging.Logger.getLogger(Logger.java:393)
          at com.google.common.collect.MapMakerInternalMap.<clinit>(MapMakerInternalMap.java:136)
          at com.google.common.collect.MapMaker.makeCustomMap(MapMaker.java:602)
          at com.google.common.collect.Interners$CustomInterner.<init>(Interners.java:59)
          at com.google.common.collect.Interners.newWeakInterner(Interners.java:103)
          at org.apache.hadoop.util.StringInterner.<clinit>(StringInterner.java:49)
          at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2293)
          at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2185)
          at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2102)
          at org.apache.hadoop.conf.Configuration.get(Configuration.java:851)
          at org.apache.hadoop.util.RunJar.run(RunJar.java:179)
          at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      

      This is caused because Configuration.loadResources() is invoked before the client classloader is created and made available.

      Attachments

        1. HADOOP-11048.patch
          0.7 kB
          Sangjin Lee
        2. HADOOP-11048.patch
          1 kB
          Sangjin Lee

        Issue Links

          Activity

            People

              sjlee0 Sangjin Lee
              sjlee0 Sangjin Lee
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: