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 105788 - Libraries with same name jar files are not copied during build
Summary: Libraries with same name jar files are not copied during build
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-05 21:17 UTC by David Botterill
Modified: 2009-11-02 11:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
0.1.2 complib (1.27 MB, application/octet-stream)
2007-06-05 21:19 UTC, David Botterill
Details
Zip file containing two jars with the same name (1.29 KB, application/octet-stream)
2007-07-18 02:06 UTC, _ edwingo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Botterill 2007-06-05 21:17:39 UTC
When I upgrade a component library, the new library doesn't get used.  It looks
like the old library is still referenced even though the new one is added.

Steps to reproduce:

1. Create a visualweb project.
2. Add the 0.1.1 AJAX complib.
3. Open the ui.jar->META-INF->rating->script.js and notice the declaration "new
Array()".
4. Add the attached 0.1.2 complib to NetBeans and do a library-> update on the
0.1.1 library.
5. Do a clean build and notice the same script.js file in the "build" directory
that has not changed.  The new 0.1.2 complib uses "{}" instead of the "new Array()".
Comment 1 David Botterill 2007-06-05 21:19:19 UTC
Created attachment 43270 [details]
0.1.2 complib
Comment 2 David Botterill 2007-06-05 21:21:03 UTC
A workaround is to delete all complibs from the project and delete the "ui.jar"
references from the library node.  Then close the IDE and delete the userdir. 
Open the IDE and readd the new complib to the project.
Comment 3 Lark Fitzgerald 2007-06-05 21:42:02 UTC
A different workaround is to undeploy the app. Do a clean build and then
re-deploy the app.  That worked for me.
Comment 4 _ edwingo 2007-07-13 23:40:42 UTC
Looking at Lark's comment and trying this myself, I'm guessing that the Platform is "Windows" and not Mac as in the bug
report. On Windows, when I do a "clean build", I get an error:

Deleting directory C:\cygwin\home\edwingo\NetBeansProjects\WebApplication57\build
C:\cygwin\home\edwingo\NetBeansProjects\WebApplication57\nbproject\build-impl.xml:781: Unable to delete file
C:\cygwin\home\edwingo\NetBeansProjects\WebApplication57\build\web\WEB-INF\lib\appbase.jar
BUILD FAILED (total time: 17 seconds)

The reason is that the appserver has the jar file locked. So that explains why Lark's workaround helps. If this is
indeed the problem, then the bug is in the "Clean build" action and not with component libraries. The "Clean build"
should undeploy the app before doing the clean. I'm not sure who to reassign to so I will redirect to Po-Ting since he
might know. There is probably another bug filed on this issue so it's probably a dup.
Comment 5 _ potingwu 2007-07-13 23:53:36 UTC
Looks like we have many issues that are related to "Server is locking some files in the project so that users cannot
Remove, Move, Copy, Upgrade, ... the projects".

All of these issues can be simply resolved by 'UNDEPLOY' the project before 'CLEAN' the project. If the web project
owner dose not think this is the right behavior, then please reassign it back to visualweb/component. Thanks!
Comment 6 David Botterill 2007-07-14 00:12:37 UTC
The original defect did indeed occur on the Mac OS X platform.  The file locking was not the issue.  Please try the
"Steps to reproduce:" on a platform with a real filesystem like Solaris or Linux.  Changing back to visualweb/components.
Comment 7 _ edwingo 2007-07-14 00:36:51 UTC
Lark: did you test this on a Mac or Windows? I don't have a Mac so it will take some time for me to test this.
Comment 8 Lark Fitzgerald 2007-07-16 17:43:17 UTC
windows only.
Comment 9 _ edwingo 2007-07-16 17:48:19 UTC
Lark: do you have access to a mac?
Comment 10 Lark Fitzgerald 2007-07-16 18:15:28 UTC
I'll send you an email with a link to one.
Comment 11 _ edwingo 2007-07-18 01:58:12 UTC
I was able to reproduce on a Mac. The bug is in web/project and does not require visualweb. A simpler test case is to
create two different jar files with the same name like "foo.jar" in different directories and create two library
definitions: "MyLibarary1" and "MyLibrary2". Then create a web project and add "MyLibrary1", then build the project.
Look in the "/build/web/WEB-INF/lib" directory and see the first "foo.jar". Now, in Project Properties, remove
"MyLibrary1" and add "MyLibrary2" and "Build". If you look in the "/build/web/WEB-INF/lib" then you still see the first
"foo.jar" and not the one from "MyLibrary2". It appears that the code will not overwrite jars with the same name even if
they are different. I will attach a zip file containing two different "foo.jar" files to help the engineer reproduce
this bug.

I do not know who to assign this to so I will leave it blank -- I can't leave it blank so I will guess. Also, there is a
workaround: after updating or replacing a component library which is built on top of NetBeans Libraries, the user should
do a "Clean and Build".
Comment 12 _ edwingo 2007-07-18 02:06:08 UTC
Created attachment 45274 [details]
Zip file containing two jars with the same name
Comment 13 _ edwingo 2007-07-18 02:19:24 UTC
It was originally reported on a Mac, but it probably also happens on all platforms so I will change it to reflect that.
Comment 14 Petr Jiricka 2007-07-18 10:38:18 UTC
Assigning to Tomas.

How often will the user need to do this in practice? Since there is a simple workaround, I would say the priority is
probably P4.
Comment 15 Tomas Mysik 2007-07-23 12:59:19 UTC
I agree with Petr, changing to P3.
Comment 16 Jiri Prox 2008-04-11 01:18:55 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 17 Trey Spiva 2008-11-18 22:55:05 UTC
Moving to later

Comment 18 Quality Engineering 2009-11-02 11:17:30 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX