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

Empty Automatic-Module-Name Header

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.0, 2.11.0, 3.0.0
    • Fix Version/s: 2.11.0
    • Component/s: API, Core
    • Labels:
      None
    • Environment:

      Java 9.0.1+11 (using module-info manifests)

      Description

      The snapshot releases of log4j-api and log4j-core are currently generated with an empty Automatic-Module-Name header within their manifests. As Java 9 will look for this header first, it is impossible to compile against (with the exception of the maven-compiler-plugin which seems to circumvent this issue somehow) or load these jars even when a module-info.class is present (see below).

      This issue currently only affects 2.10.1-SNAPSHOT and 3.0.0-SNAPSHOT versions and prevents developers from integrating log4j in their modular projects entirely (since the latest stable release (2.10.0) is affected by LOG4J2-2129 and thus fails to load within these environments as well).

      A test project which will produce the errors outlined below is available here (compiler errors only seem to occur within IDEs, runtime errors do occur regardless of compilation method).

      Error Messages

      java: cannot determine module name for <home>\.m2\repository\org\apache\logging\log4j\log4j-core\2.10.1-SNAPSHOT\log4j-core-2.10.1-20180131.145844-171.jar
      java: cannot determine module name for <home>\.m2\repository\org\apache\logging\log4j\log4j-core\3.0.0-SNAPSHOT\log4j-core-3.0.0-20180216.142957-18.jar
      
      Error occurred during initialization of boot layer
      java.lang.module.FindException: Unable to derive module descriptor for target\log4j-core-3.0.0-SNAPSHOT.jar
      Caused by: java.lang.module.FindException: Automatic-Module-Name: : Invalid module name: '' is not a Java identifier
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              .start Johannes Donath
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: