Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5242

LoggerBridge loading under the wrong class loader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0 JBIG2, 3.0.1 JBIG2, 3.0.2 JBIG2, 3.0.3 JBIG2
    • 3.0.4 JBIG2
    • JBIG2
    • None
    • Java 16

    Description

      When used in a Tomcat servelet LoggerBridge has a different class loader to JDKLoggerBridge  so when it dose if (service.isAssignableFrom(clazz)) { in java.util.ServiceLoader it fails.

      took the source to 3.0.3 and replaced all.

      private static final Logger log

      with

      private final Logger log

      and also added , Thread.currentThread().getContextClassLoader() as a parameter to LoggerFactory.getLogger .

       

      This fixed the problem for me, not too sure if Thread.currentThread().getContextClassLoader() is over kill as I think it is the static that is causing the problem.

      Attachments

        Issue Links

          Activity

            People

              lehmi Andreas Lehmkühler
              cmd1234 Clifford Dann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: