Bug 132591 - Duplicate exception with aop.xml file on aspectpath
Summary: Duplicate exception with aop.xml file on aspectpath
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matthew Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-20 15:51 EST by Ron Bodkin CLA
Modified: 2006-06-13 10:13 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2006-03-20 15:51:21 EST
See also bug #57666 which is related (but has to do with manifests):

I have a META-INF/aop.xml file in my aspectpath and another one in the source path. That shouldn't even be a duplicate, because the aspectpath resource should NOT be copied to output at all.

In AspectJ build:  1.5.1.20060309143651

I am now getting:

java.util.zip.ZipException
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.writeOutxmlFile(AjBuildManager.java:549)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:320)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:163)
at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122)
at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

ZipException thrown: duplicate entry: META-INF/aop.xml
Comment 1 Matthew Webster CLA 2006-06-01 12:46:09 EDT
I the problem is occuring because you are using either -outxml or -outxmlfile. Could you post the commandline or Ant options you are using? This option will generate an aop.xml file for those aspects visible to the weaver which is probably clashing with the one in the source path. We don't copy resources from aspectpath.

Now of cause we shouldn't throw an exception so I propose the first come first served approach we used for manifests. Therefore in you case we will ignore the -outxml/outfile option. But should we issue and error/warning?
Comment 2 Matthew Webster CLA 2006-06-02 08:13:28 EDT
1. Added test for existing aop.xml to OutXmlTest
2. Modified NullIdeProperties to allow testProjectPath to be overriden by sourceRoots
3. Issue warning message inAjBuildManager.writeResource() to say -outxml ignored
Comment 3 Ron Bodkin CLA 2006-06-02 10:11:22 EDT
You are right - there was both a META-INF/aop.xml file in the sources and an -outxml file option. The project was having this error in AJDT. Removing the -outxml option fixes the problem. Thanks and as you say this is a good condition to detect and warn about, with then not generating a file.
Comment 4 Matthew Webster CLA 2006-06-13 10:13:15 EDT
Fix available