Commons Logging
  1. Commons Logging
  2. LOGGING-13

[logging] NullPointException when Logger.getClassLoader returns null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.1.0
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: PC

      Description

      getClassLoader can return null to imply the Boot Class Loader (per JDK 1.3
      documentatio at least) however unfortunately commons logging is not coded to
      support that.

      There are at least two places where this is a problem & commons logging dies w/
      a NullPointerException, one in a Hashtable (used as a key to factory) [HashMap
      allows null key, Hashtable does not] and one other more directly.

      I modified the code to use the ClassLoader.getSystemClassLoader() when a null
      was returned for Logger.getClassLoader() – assuming ['cos I had no better
      guess/choice] that System == Boot [since there was no getBootClassLoader.] This
      appears to be working.

      I can send my modified code if interested.

      1. ASF.LICENSE.NOT.GRANTED--LogFactory.java
        21 kB
        Adam Jack
      2. ASF.LICENSE.NOT.GRANTED--LogFactory.java
        20 kB
        Adam Jack
      3. ASF.LICENSE.NOT.GRANTED--patch.txt
        6 kB
        Volker Leidl
      4. ASF.LICENSE.NOT.GRANTED--patch.txt
        2 kB
        Erik Erskine

        Activity

        Dennis Lundberg made changes -
        Fix Version/s 1.1.0 [ 12311848 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311790 ]
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Logging [ 12310484 ]
        Key COM-118 LOGGING-13
        Affects Version/s Nightly Builds [ 12311648 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Logging [ 12311124 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 10825 12340269
        Adam Jack created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Adam Jack
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development