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 112529 - Clean target on running web app fails on Windows
Summary: Clean target on running web app fails on Windows
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 92021 115952 123777 136235 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-10 10:23 UTC by Tomas Mysik
Modified: 2008-09-15 17:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace (4.29 KB, text/plain)
2007-08-10 10:24 UTC, Tomas Mysik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2007-08-10 10:23:11 UTC
steps to reproduce:
1) create Web project with Visual Java Server Faces
2) run project
3) rename project (with renaming the directory as well) via the context menu

Product Version: NetBeans IDE Dev (Build 070810) 'FULL IDE'
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
GlassFish V2 build b58-rc1
Comment 1 Tomas Mysik 2007-08-10 10:24:30 UTC
Created attachment 46451 [details]
stacktrace
Comment 2 Vince Kraemer 2007-08-15 22:13:19 UTC
yup. since the app is in use... the jar is in use...
 
work-around? stop the server before doing the rename operation.

(that will lead to other issues when the server restarts... since the app is GONE)

We may be able to add some listener on directory deployed projects... that would track the rename/delete operations..
but that is a future thing.
Comment 3 tomzi 2007-08-17 11:35:54 UTC
same for tomcat....
Comment 4 Vince Kraemer 2007-08-22 17:12:18 UTC
change summary from "cannot delete prototype.1.5.0.jar"
Comment 5 Vince Kraemer 2007-09-18 18:56:45 UTC
since this spans server plugins, the solution would probably need to get implemented primarily in the j2eeserver module.
Comment 6 Petr Hejl 2007-09-19 16:27:32 UTC
*** Issue 115952 has been marked as a duplicate of this issue. ***
Comment 7 Petr Hejl 2007-09-19 16:29:48 UTC
change summary from "Rename project (and directory) of running web app fails on Windows"
Comment 8 Petr Hejl 2007-09-19 16:40:54 UTC
The correct solution is to call undeploy before clean.

However this works only when the jars are _not_ locked due to ClassLoader.getResource(). Tomcat for instance handle it
by the webapp classloader property configurable in context.xml (antiJARLocking). I don't know about any such solution
for the glassfish (although it suffer from the same locking issues, see links below). I'm not sure this can be handled
at all (without some risky bootstrap classloader settings). I will investigate it further.

http://tomcat.apache.org/faq/windows.html#lock
http://blogs.sun.com/quinn/entry/addressing_locked_jar_problems
Comment 9 Petr Hejl 2007-09-20 14:19:16 UTC
Calling undeploy before clean could be solved by patch for the following enhancement issue 83122. However the jar
locking issue will not be fixed by it (in general).
Comment 10 Petr Hejl 2007-09-28 19:10:11 UTC
It would need a support of app server. There could be done some partial (enhancement issue 83122) solution for 6.0.
Comment 11 Petr Hejl 2007-10-03 19:47:10 UTC
This is also adressed by request for enhancement on jdk: http://bugs.sun.com/view_bug.do?bug_id=4950148
Comment 12 Petr Hejl 2007-10-08 14:50:34 UTC
The current problem for visual jsf is caused by the woodstock project using the sun.misc.Service. I filed the issue:
https://woodstock.dev.java.net/issues/show_bug.cgi?id=812
Comment 13 Vince Kraemer 2008-01-08 00:33:40 UTC
*** Issue 92021 has been marked as a duplicate of this issue. ***
Comment 14 Petr Hejl 2008-02-01 09:18:05 UTC
*** Issue 123777 has been marked as a duplicate of this issue. ***
Comment 15 Petr Hejl 2008-02-18 10:05:12 UTC
The impact of the issue should be lower after this jdk bug will be fixed: http://bugs.sun.com/view_bug.do?bug_id=6587593

This should happen for jdk6u10.
Comment 16 Petr Hejl 2008-06-02 09:13:24 UTC
*** Issue 136235 has been marked as a duplicate of this issue. ***
Comment 17 Petr Hejl 2008-09-10 15:38:06 UTC
Issue 83122 contains the patch I would like to apply after some additional testing. It should solve this issue.
The possible drawback is undeploy on each clean. There is now way (afaik) how to figure out whether app was deployed
from a directory or in a standard way.
Comment 18 Petr Hejl 2008-09-15 10:20:49 UTC
Should be fixed by undeploy on clean. Fixed in main 5d7eec56a42d.
Comment 19 Quality Engineering 2008-09-15 17:38:56 UTC
Integrated into 'main-golden', will be available in build *200809151401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5d7eec56a42d
User: phejl@netbeans.org
Log: #112529 Clean target on running web app fails on Windows (undeploy performed on clean)