Uploaded image for project: 'Commons Logging'
  1. Commons Logging
  2. LOGGING-13

[logging] NullPointException when Logger.getClassLoader returns null

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Nightly Builds
    • 1.1.0
    • None
    • Operating System: All
      Platform: PC

    • 10825

    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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ajack@openbiz.biz Adam Jack
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment