Bug 57666 - duplicate manifests cause resource-copying to gack
Summary: duplicate manifests cause resource-copying to gack
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Matthew Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66267 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-06 17:22 EDT by Wes Isberg CLA
Modified: 2004-10-21 04:31 EDT (History)
2 users (show)

See Also:


Attachments
Testcase and fix (5.18 KB, application/octet-stream)
2004-07-30 09:47 EDT, Matthew Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2004-04-06 17:22:16 EDT
(Ah, the joy of build infrastructure...)

Mostly self-explanatory trace, from a build Monday Apr 5, 2004 at 08:46:01 GMT:

duplicate entry: META-INF/MANIFEST.MF
duplicate entry: META-INF/MANIFEST.MF
java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF
	at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:163)
	at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:90)
	at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.writeResource(AjBuildManager.java:344)
	at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.copyResourcesFromJarFile(AjBuildManager.java:288)
	at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.copyResourcesToDestination(AjBuildManager.java:253)
	at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:195)
	at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:94)
	at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:102)
	at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:53)
	at org.aspectj.tools.ajc.Main.run(Main.java:280)
	at org.aspectj.tools.ajc.Main.runMain(Main.java:217)
	at org.aspectj.tools.ajc.Main.main(Main.java:79)
Comment 1 Matthew Webster CLA 2004-04-07 05:49:05 EDT
There are several routes into this code. Could you attach a testcase or 
describe what you were doing when the failure occured.

Thanks
Comment 2 Wes Isberg CLA 2004-04-09 08:08:23 EDT
Sorry, no time now to try to create a test case.  Perhaps the manifest file
automatically included when the zip is created is not added to the list of known
resources in AjState.  
Comment 3 Matthew Webster CLA 2004-07-30 09:08:50 EDT
*** Bug 66267 has been marked as a duplicate of this bug. ***
Comment 4 Matthew Webster CLA 2004-07-30 09:17:36 EDT
Using a JarInputStream is a bit of a minefield. Its behaviour, especially 
WRT "getManifest()", varies accounding to how the JAR file was build: ZIP vs 
JAR. To ensure the first orginal manfiest encountered is copied injars/inpath 
to outjar:
1. Use JarFile rather than JarInputStream
2. Explicitly test for "META-INF/MANIFEST.MF" entry
3. Add DiplicateManifestTest to weave a JAR built using ZIP
Comment 5 Matthew Webster CLA 2004-07-30 09:47:32 EDT
Created attachment 13683 [details]
Testcase and fix

ajde: testcase & data
ajdt: AjBuildManager & BcweaverJarMaker
weaver: BcelWeaver

1. Apply 3 patches and import ZIP
2. Run BcweaverJarMaker and run
"ajde/testdata/DuplicateManifestTest/update-injar.xml (Ant) to create injar.jar
and aspectjar.jar
Comment 6 Andrew Clement CLA 2004-08-02 11:59:46 EDT
Matthews fix integrated.  Waiting for build note before closing bug.
Comment 7 Andrew Clement CLA 2004-08-02 15:16:00 EDT
Fix available:

BUILD COMPLETE -  build.325
Date of build: 08/02/2004 17:56:01
Time to build: 89 minutes 54 seconds
Last changed: 08/02/2004 16:47:52
Last log entry: Fix for Bugzilla Bug 57666 duplicate manifests cause
resource-copying to gack(Contributed by Matthew Webster)
Latest good AspectJ jar available at:
download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Comment 8 Adrian Colyer CLA 2004-10-21 04:31:30 EDT
Fix released as part of AspectJ 1.2.1