Bug 54455 - DynamicImport-Package in MANIFEST.MF not working in Eclipse
Summary: DynamicImport-Package in MANIFEST.MF not working in Eclipse
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.2.17
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 15:51 UTC by Dave Hartnoll
Modified: 2013-01-23 15:07 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hartnoll 2013-01-21 15:51:17 UTC
The "DynamicImport-Package: *" attribute in MANIFEST.MF appears to be ineffective in Eclipse (Juno (4.2) SR1, other releases not checked).

One possible reason for the failure is that the attribute is included within an individual-section* (i.e. after the Name: value) line, and not within the main-section* of the manifest. I've tried moving the DynamicImport-Package to the Main Section and that resolves my problem (DI-P behaves as I expect).

* See http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR%20Manifest for a definition of these terms.

To clarify, I changed this:

[...]
Bundle-SymbolicName: log4j
Import-Package: javax.jmdns;resolution:=optional,javax.jms;resolution:
 =optional,javax.mail;resolution:=optional,javax.mail.internet;resolut
 ion:=optional,javax.management,javax.naming,javax.xml.parsers,org.w3c
 .dom,org.xml.sax,org.xml.sax.helpers

Name: org.apache.log4j
DynamicImport-Package: *
Implementation-Vendor: "Apache Software Foundation"
[...]

... to this ...

[...]
Bundle-SymbolicName: log4j
Import-Package: javax.jmdns;resolution:=optional,javax.jms;resolution:
 =optional,javax.mail;resolution:=optional,javax.mail.internet;resolut
 ion:=optional,javax.management,javax.naming,javax.xml.parsers,org.w3c
 .dom,org.xml.sax,org.xml.sax.helpers
DynamicImport-Package: *

Name: org.apache.log4j
Implementation-Vendor: "Apache Software Foundation"
[...]

Also, removing the blank line before "Name: ..." seems to work.

I noticed some changes to Name for 1.2.18: in Bug 44370, but making those changes has no effect on DI-P behaviour.

There's also some relevant discussion in Bug 43282 but I think this is a separate issue.