This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 115184 - getArchiveContents() doesn't abide by Javadoc
Summary: getArchiveContents() doesn't abide by Javadoc
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EAR (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
: 114728 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-10 20:22 UTC by Vince Kraemer
Modified: 2007-10-30 17:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a first pass implementation of a solution for this. (4.16 KB, text/plain)
2007-09-10 22:31 UTC, Vince Kraemer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2007-09-10 20:22:37 UTC
If the user has an ear project that has a web app and a ejb-jar archive, the iterator returned by getArchiveContents is
NOT supposed to return a value for web app archive or the ejb-jar according to its javadoc and usage when doing
directory deployment.

The unnecessary presence of the EJBModule2.jar may be contributing to issue 114728.  The jar file is being copied
because of the error in the implementation of ProjectEar.getArchiveContents()..
Comment 1 Vince Kraemer 2007-09-10 22:29:48 UTC
change the way the iterator is created, so that the J2eeModule archives are very likely to not be included in the set of
file objects returned...

Implement a heuristic in the patch that I will attach.. if the name, extension and size match a jar file that implements
a J2eeModule, the jar is not returned by the iterator. This seems like a 90% solution.

There may be a 100% solution for this, but this better than the current implementation, which is just plain wrong.
Comment 2 Vince Kraemer 2007-09-10 22:31:34 UTC
Created attachment 48523 [details]
a first pass implementation of a solution for this.
Comment 3 Vince Kraemer 2007-09-11 19:56:08 UTC
i just tested issue 114728 with this patch applied and I cannot reproduce it...
Comment 4 Vince Kraemer 2007-09-11 20:08:48 UTC
*** Issue 114728 has been marked as a duplicate of this issue. ***
Comment 5 Vince Kraemer 2007-09-11 20:10:03 UTC
can you let me know whether you are going to review this patch or do you just want me to check it in...
Comment 6 Tomas Mysik 2007-09-18 12:10:15 UTC
Because it's related to the directory-based deployment, feel free to fix this issue (but please be sure that 'normal' 
deployment keeps working). So reassigning to you, Vince.
Comment 7 Vince Kraemer 2007-09-18 18:11:03 UTC
http://www.netbeans.org/source/browse/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/ProjectEar.java?r1=1.25&r2=1.26

differs from original patch... avoid an O(n^2) search to filter the iterator content...
Comment 8 nouar38 2007-10-30 17:10:27 UTC
NB 6.0 daily 200710231200 & GF v2 ur1-b06 on windows/xp : have only clean error when the app is still deployed which
normal, if ear app is undeployed from services, a clean action just after undeploy will fail, a second "clean & build"
ok, (undeploy & deploy many times ok).

(clean & build ) many times: can have two successive failures and after success, ...etc. Better than before.