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 108694 - Continous "Refreshing Workspace" scan after Rename Project
Summary: Continous "Refreshing Workspace" scan after Rename Project
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on: 94247 112018
Blocks:
  Show dependency tree
 
Reported: 2007-07-02 23:15 UTC by _ krystyna
Modified: 2007-10-24 00:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages log with thread dumps (58.88 KB, application/octet-stream)
2007-07-02 23:17 UTC, _ krystyna
Details
Continuous scan (15.00 KB, application/octet-stream)
2007-08-04 00:38 UTC, _ krystyna
Details
thread dumps (31.25 KB, application/octet-stream)
2007-08-04 00:40 UTC, _ krystyna
Details
rename undeploy (11.66 KB, application/octet-stream)
2007-08-04 00:41 UTC, _ krystyna
Details
undeployandstop (2.63 KB, application/octet-stream)
2007-08-04 00:42 UTC, _ krystyna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ krystyna 2007-07-02 23:15:24 UTC
Nb trunk standard installer 20070702000
XP
JDK1.6.0_02

1. New userdir
2. Created a VWP EE5 project and deployed it to Glassfish
3. Renamed the project via context menu and also checked Rename Project Folder
>first error: 

Deleting directory C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869\build
C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869\nbproject\build-
impl.xml:766: 
Unable to delete file C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869
\build\web\WEB-INF\lib\appbase.jar
BUILD FAILED (total time: 9 seconds)

>second error:
Deleting directory C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869\build
C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869\nbproject\build-
impl.xml:766: 
Unable to delete file C:\Documents and Settings\Krystyna Polomski\My Documents\NetBeansProjects\WebApplication869
\build\web\WEB-INF\lib\appbase.jar
BUILD FAILED (total time: 9 seconds)

>third error Project is in continuous scanning state "Refreshing Workspace". Thread dumps attached.

>webapp name does not change in project view
Comment 1 _ krystyna 2007-07-02 23:17:49 UTC
Created attachment 44638 [details]
messages log with thread dumps
Comment 2 Petr Jiricka 2007-07-03 11:49:34 UTC
Assigning to Tomas.
Comment 3 Tomas Mysik 2007-07-11 14:02:13 UTC
After some investigation it is hard to say what's wrong - no deadlock found in the log. I also wasn't able to 
reproduce it (nb 070711, linux, jdk 1.6.0_01-b06). I'm going to try it (and debug) on windows.
According to Bug Priority Guidelines changing to P2.
Comment 4 _ krystyna 2007-07-11 18:01:33 UTC
With installer build 07101200 I did reproduce the "refreshing workspace" continuous scan switching to jdk1.6.0_01
on Windows XP -- AssertionError to log and then the build fails unable to delete appbase.jar. I went ahead and
re-deployed but I am still see the refreshing workspace scan. The project is *not* renamed in project view. I agree that
it is not 100% reproducible but I think there is a problem renaming a project after it has been once deployed.
Comment 5 _ potingwu 2007-07-11 18:18:52 UTC
Do you see this symptom even after 'undeploy' your project, or stop your server? As I remember that some servers will
lock some jar files in the project and make it cannot be deleted.
Comment 6 _ krystyna 2007-07-11 18:40:28 UTC
I just undeployed all my apps and renamed project and the build failed with same appbase.jar error.
The webapp was not renamed in project view, but I was able to redeploy and see "renamedWebApp"
in the lower right hand name. The app when deployed came up with the old name. I closed the project
and on "Open Recent Project" I see two WebApp922 projects listed - same name - and I can open them.

I then deployed an app, stopped the server, then renamed the project, and then I did see the webapp renamed 
in project view, but I got the continuous refresh workspace error. Ignored it and redeployed and it did, 
with the new project name in the browser, but I'm still getting this refresh workspace. (If you are here in mpk16,
drop on by!) At least in this case the project was renamed.

Comment 7 _ krystyna 2007-07-17 00:27:39 UTC
Testing with 07160000 on XP.

Behavior has changed. I no longer see the continuous scan error but get IllegalStateExceptions:

1. stopping the server before the rename now throws an IllegalStateException when the project is redeployed.I do not see
the continuous scanning. 
2. NOT stopping the server has the same effect to throw and IllegalStateException ("project is open") but 
I am still waiting for renamed project to open in designer. it appears to have been renamed in proejct view, ok and
builds, ok, and redeploys OK, but the designer is inactive and shows Loading, please wait.



Comment 8 Petr Jiricka 2007-08-03 21:40:01 UTC
So is this an issue in the core web features? Sounds like the remaining problem is in visual web, correct?
Comment 9 _ potingwu 2007-08-03 22:01:51 UTC
Now the issue is the 'IllegalStateExceptions'. Please attach the stack trace of this exception.
Comment 10 _ krystyna 2007-08-04 00:37:22 UTC
Different exceptions in testing with 08030000 build, XP, JDK1.5.0_12,
3 scenarios, the first two fail in renaming the project, the third is successful.

1: Re-testing using original scenario, I reproduced the continuous refresh workspace scan. Attaching logger    
   exceptions(AssertionError) and thread dumps.

2: Re-testing but undeployed the app before the rename, attaching exceptions from logger (NPE)

3. Re-testing but undeployed the app and stopped the appserver before the rename. Rename succeeded but did throw 
   NPE to logger (attaching)
Comment 11 _ krystyna 2007-08-04 00:38:49 UTC
Created attachment 46143 [details]
Continuous scan
Comment 12 _ krystyna 2007-08-04 00:40:28 UTC
Created attachment 46144 [details]
thread dumps
Comment 13 _ krystyna 2007-08-04 00:41:29 UTC
Created attachment 46145 [details]
rename undeploy
Comment 14 _ krystyna 2007-08-04 00:42:44 UTC
Created attachment 46146 [details]
undeployandstop
Comment 15 Tomas Mysik 2007-08-06 10:28:21 UTC
I filed an issue for NPE, see issue 112018.
Comment 16 Tomas Mysik 2007-08-06 15:32:36 UTC
So, for me, after some investigation, it looks like that the solution would be to undeploy the application before 
renaming it. But unfortunately this is not doable for NB 6.0 because there's no possibility to call 'undeploy' action 
from a module (now, undeploy is done only via the context menu for a server in Services tab). But that wouldn't be 
still enough I guess because the module doesn't know if it's currently deployed or not (this is important for the case 
when the server is not running - it would have to be started in order to undeploy the application).

Any ideas? Any comments please? Thanks.
Comment 17 Tomas Mysik 2007-08-06 15:35:55 UTC
Just FYI I've found another issue (issue 112017) while investigating this one.
Comment 18 _ krystyna 2007-08-08 21:06:01 UTC
If we want to continue to provide the project rename feature we should provide sufficient information dialogs to direct 
users to undeploy, etc. Get HIE to help with contents and style of that message. (We do something similar for VWP when 
changing themes where we need user to restart appserver).


Comment 19 Tomas Mysik 2007-08-09 09:57:05 UTC
The problem is that there's no API for detecting if the application is deployed and if the server is running - so the 
dialog would have to be shown every time.
Comment 20 _ krystyna 2007-08-09 19:57:32 UTC
In VWP we couldn't detect either, but put up an Informational dialog asking user to restart appserver. 
(Create VWP 1.4 project and switch theme to see this dialog. )    Rename of a project is not going 
to occur on a high frequency. 
Comment 21 Tomas Mysik 2007-08-10 10:38:44 UTC
First of all - I've discussed this issue with Petr Jiricka and he told me that 'undeploy' action is not 
necessary - 'clean' action has to be enough and GlassFish *has to* free all the resources after this action. So if 
such exception occurs please file a bug against serverplugins, sunappserver9.

I've done some tests with the latest versions and here are the results:

Scenarios:
1) create project -> rename
2) create project -> build & clean -> rename
3) create project -> run -> rename
4) create project -> run -> undeploy -> stop the server -> rename
(after each scenario IDE has been restarted)

All 4 scenarios have been tested with both 'pure' Web project and Visual Web project.

Web project:
------------
1) OK
2) OK
3) OK
4) OK
In all 4 scenarios NPE occurs - see issue 112018 - but the rename action has been successful.

Visual Web project:
-------------------
1) OK (NPE)
2) OK (NPE)
3) *KO*
4) OK (NPE)
As can be seen only one scenario has failed - only if the application has been deployed the rename operation has 
failed - 'cannot delete prototype.1.5.0.jar' so I filed issue 112529 against serverplugins. Remaining 3 scenarios were 
successful (but again see issue 112018).

During this testing I've discovered one more bug, see issue 112530.

So I suggest to close this issue as FIXED. If any error related to this issue occurs reopen it please. Thank you.

Environment:
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 22 _ krystyna 2007-10-23 02:11:37 UTC
Verified that can rename a deployed app on Windows. 
NetBeans IDE Dev (Build 200710220000)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02
Comment 23 _ krystyna 2007-10-24 00:15:59 UTC
The rename works for an already deployed app only if you are not renaming the project folder. Only rename of project.