Bug 44370

Summary: MANIFEST.MF broken in log4j-1.2.15.jar
Product: Log4j - Now in Jira Reporter: Dominique LAURENT <lauredo>
Component: OtherAssignee: log4j-dev <log4j-dev>
Status: RESOLVED FIXED    
Severity: regression    
Priority: P2    
Version: 1.2   
Target Milestone: 1.2.18   
Hardware: All   
OS: All   

Description Dominique LAURENT 2008-02-06 10:21:20 UTC
The manifest (MANIFEST.MF) in log4j-1.2.15.jar now uses:
 
 
Name: org.apache.log4j
 
instead of
 
 
Name: org/apache/log4j/
 

in previous versions (1.2.14, 1.2.13, etc) 


Note the dot '.' instead of the slash '/'.
 

This means that the following piece of code:
 
        String implementationVersion =
org.apache.log4j.Appender.class.getPackage().getImplementationVersion();
        System.out.println('"' + implementationVersion + '"');
 
now returns "null" instead of "1.2.15" as it would have done with previous releases.
 
Changing the MANIFEST.MF line "Name: org.apache.log4j" into "Name:
org/apache/log4j/" solves the issue.
Comment 1 Dominique LAURENT 2008-02-06 10:23:43 UTC
Proposed patch for MANIFEST.MF:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: ubuntu
Build-Jdk: 1.6.0

Name: org/apache/log4j/
Implementation-Title: log4j
Implementation-Vendor: "Apache Software Foundation"
Implementation-Version: 1.2.15

Comment 2 Curt Arnold 2008-02-06 12:29:03 UTC
I've confirmed it is a change from log4j 1.2.14 and earlier.  It may have been a mistake when writing 
the Maven POM file, but it may have been intentional and needs a bit more research to see if there was 
a motivation behind the change.

From http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Manifest%20Specification

The individual sections define various attributes for packages or files contained in this JAR file. Not all 
files in the JAR file need to be listed in the manifest as entries, but all files which are to be signed must 
be listed. The manifest file itself must not be listed.  Each section must start with an attribute with the 
name as "Name", and the value must be a relative path to the file, or an absolute URL referencing data 
outside the archive.

So the name definitely should be separated with slashes.

MANIFEST.MF is generated from the specification in pom.xml.  Any patch would be against pom.xml.

Also, it would be good to try to coordinate this with any changes related to http://issues.apache.org/bugzilla/show_bug.cgi?id=43282
Comment 3 Thorbjørn Ravn Andersen 2008-08-02 14:10:27 UTC
Should be clarified before 1.2.16
Comment 4 grobmeier 2012-05-31 13:20:40 UTC
fixed with rv1344711

Manifest shows:

Name: org/apache/log4j/
Implementation-Vendor: "Apache Software Foundation"
DynamicImport-Package: *
Implementation-Title: log4j
Implementation-Version: 1.2.18-SNAPSHOT