You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Johannes Donath (JIRA)" <ji...@apache.org> on 2018/02/17 01:12:00 UTC

[jira] [Created] (LOG4J2-2254) Empty Automatic-Module-Name Header

Johannes Donath created LOG4J2-2254:
---------------------------------------

             Summary: Empty Automatic-Module-Name Header
                 Key: LOG4J2-2254
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2254
             Project: Log4j 2
          Issue Type: Bug
          Components: API, Core
    Affects Versions: 2.10.0, 2.11.0, 3.0.0
         Environment: Java 9.0.1+11 (using module-info manifests)
            Reporter: Johannes Donath


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|https://github.com/dotStart/log4j-jigsaw-test] (compiler errors only seem to occur within IDEs, runtime errors do occur regardless of compilation method).
h3. Error Messages
{code:java}
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{code}
{code:java}
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
{code}
{code:java}
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
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)