Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2266

Log4j2 throws NoClassDefFoundError in Java 8

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.11.2
    • Component/s: None
    • Labels:
      None

      Description

      During Unit Tests run using JDK 8 and Log4j2 v2.10.0 - getting this as part of exception stack:

       

      java.lang.NoClassDefFoundError: Could not initialize class
      org.apache.logging.log4j.util.PropertiesUtil
          at org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:71)
          at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:60)

       

      and issue seems to be somehow related to what is reported so far against JDK 9 here: LOG4J2-2129.

       

      If some patch on top of v2.10.0 is available to test - please let me know where to download it from.

       

      While running same UTs with same JDK 8 and v2.8.2 - issue is not observed.

       

      And question which I have here - why not introduce JDK8 compatibility runtime mode while things with JDK9 are not yet that stable? So it could continue use same logic as of v2.8.2 around that ServiceLoader and not cause side effects.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andrejusc Andrejus Chaliapinas
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: