Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-101

logback fails to initialise when loaded from bootstrap classpath

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • None
    • None

    Description

      When logback is put in the endorsed library path of the jdk, it fails to initialise because the getClassLoader() call returns null in a couple of places.

      Returning null is expected when the classloader is the bootstrap classloader, as is the case when logback is loaded from the endorsed directory.

      Here's a snippet from the sun jdk javadoc for Class.getClassLoader()

      "Returns the class loader for the class. Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class was loaded by the bootstrap class loader."

      I'm using jacorb 2.3.1, which uses slf4j-api 1.5.6. Jacorb is required to be in the endorsed lib to work, and hence any logging implementation has to go there too.

      I patched my logback instance to return the system classloader when the null classloader is encounterd.

      Attaching patch.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            matherb Henric Larsson
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: