Commons Logging
  1. Commons Logging
  2. LOGGING-25

[logging] call to getClassLoader() in LogFactoryImpl not checked for null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4
    • Fix Version/s: 1.1.0
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      In line 374 of LogFactoryImpl.java getClassLoader() is called:

      logInterface = this.getClass().getClassLoader().loadClass(LOG_INTERFACE);

      However, the docs for getClassLoader() state that some implementations may use
      null to return the system classloader. This occurs under CrEme a JVM for the
      PocketPC platform which some of our products run under, causing a null pointer
      exception. Perhaps it would be better to change line 374 to read:

      logClass = loadClass(LOG_INTERFACE);

      which seems to solve the problems I have been having. At any rate calls to
      getClassLoader() should be checked to ensure that they haven't returned null.

      In addition the error that I got:
      org.apache.commons.logging.LogConfigurationException:
      org.apache.commons.logging.LogConfigurationException:
      java.lang.NullPointerException (Caused by java.lang.NullPointerException)
      (Caused by org.apache.commons.logging.LogConfigurationException:
      java.lang.NullPointerException (Caused by java.lang.NullPointerException))

      Certianly wasnt very helpfull for figuring out what is going on.

      • Luke

        Activity

        Dennis Lundberg made changes -
        Fix Version/s 1.1.0 [ 12311848 ]
        Simon Kitching made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Simon Kitching made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Simon Kitching made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Henri Yandell made changes -
        Affects Version/s 1.0.4 [ 12311713 ]
        Henri Yandell made changes -
        Affects Version/s 1.0.4 [ 12311678 ]
        Key COM-2563 LOGGING-25
        Component/s Logging [ 12311124 ]
        Project Commons [ 12310458 ] Commons Logging [ 12310484 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 37484 12342715
        Luke Sleeman created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Luke Sleeman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development