NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Can't delete jar during clean/build

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
BillyRay



Joined: 18 Mar 2009
Posts: 24

PostPosted: Fri May 27, 2011 3:05 am    Post subject: Can't delete jar during clean/build Reply with quote

Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay
Back to top
jyeary



Joined: 21 Oct 2008
Posts: 612
Location: Simpsonville, SC

PostPosted: Fri May 27, 2011 1:35 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

This is an ongoing issue with Windows. On GF2, you could set it to not use directory deployment which resolved the issue.

Please file a bug report with your details.

John

On Thu, May 26, 2011 at 11:05 PM, BillyRay <address-removed ([email]address-removed[/email])> wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1...
Back to top
Tim Quinn
Posted via mailing list.





PostPosted: Fri May 27, 2011 2:44 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

Before filing a bug against GlassFish, please make sure GlassFish is at fault.


You can download a simple tool and read how to use it from this blog:


http://blogs.oracle.com/quinn/entry/tool_for_diagnosing_failed_glassfish


Follow the directions carefully so that you gather the information we need. Then please post the output from the "show" command (as described in great detail in the blog) to this list. If the output implicates GlassFish then we'll definitely want you to open a GlassFish issue.


- Tim

On May 27, 2011, at 7:54 AM, John Yeary wrote:
Quote:
This is an ongoing issue with Windows. On GF2, you could set it to not use directory deployment which resolved the issue.

Please file a bug report with your details.

John

On Thu, May 26, 2011 at 11:05 PM, BillyRay <address-removed ([email]address-removed[/email])> wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay







--
John Yeary
--
http://javaevangelist.blogspot.com
http://www.johnyeary.com
@jyeary

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt
Back to top
Jeffrey Rubinoff
Posted via mailing list.





PostPosted: Fri May 27, 2011 4:05 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

I've always experienced this problem. I assumed it had something to do with Windows.

On 5/27/2011 2:54 PM, John Yeary wrote:
Quote:
This is an ongoing issue with Windows. On GF2, you could set it to not use directory deployment which resolved the issue.

Please file a bug report with your details.

John

On Thu, May 26, 2011 at 11:05 PM, BillyRay <address-removed ([email]address-removed[/email])> wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay







--
John Yeary
--
http://javaevangelist.blogspot.com
http://www.johnyeary.com
@jyeary

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt
Back to top
Tim Quinn
Posted via mailing list.





PostPosted: Fri May 27, 2011 4:10 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

On May 27, 2011, at 9:19 AM, Jeffrey Rubinoff wrote:
Quote:
I've always experienced this problem. I assumed it had something to do with Windows.



It does have something to do with Windows, but only if a file is opened but not closed. Unlike non-Windows platforms, Windows does not allow an open file to be deleted or renamed. The tool I referred to earlier helps to identify files that are opened but not closed and shows where they were opened from. That usually gives a pretty good idea what code should close the file.


-Tim

Quote:

On 5/27/2011 2:54 PM, John Yeary wrote:
Quote:
This is an ongoing issue with Windows. On GF2, you could set it to not use directory deployment which resolved the issue.

Please file a bug report with your details.

John

On Thu, May 26, 2011 at 11:05 PM, BillyRay <address-removed ([email]address-removed[/email])> wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay







--
John Yeary
--
http://javaevangelist.blogspot.com
http://www.johnyeary.com
@jyeary

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt


Back to top
Rick
Posted via mailing list.





PostPosted: Fri May 27, 2011 4:51 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

Hi BillyRay,

I've had this problem off and on with several versions of NetBeans when
writing web apps using Tomcat too.

You have to stop GlassFish to get it to do a clean and build when it
does that, as you found. GF will restart when you run the app again.
You can clean and build several times, then it will hang again and you
have to stop it again.

To stop GF without stopping NetBeans, go to the "Services" tab, open the
"Server" tree, and right-click on the version of GF that is running and
select "Stop".

You'll see a progress indicator at the bottom right corner of the
NetBeans frame that tells you when it's done. I've found that I can
wait a second or two then start the "Clean ad Build." By the time it
needs to clean the directories, the server has released the locks. That
may vary from system to system.

This is a pain but it is much faster than restarting NetBeans when this
happens. Also, if you have "Compile on Save" selected in the project
properties, you don't need to run the app again for incremental updates,
just refresh the browser.

Turning off "Compile on Save" may reduce or prevent the hangs on "Clean
and Build."

I don't know what the underlying problem is with GF and Tomcat not
releasing the lock on the files, though.

Hope this helps.

Rick

On 5/26/2011 11:05 PM, BillyRay wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay


Back to top
Vince Kraemer
Posted via mailing list.





PostPosted: Fri May 27, 2011 5:27 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

This issue has been around for a long time.

My recommendation is going to sound like a famous punchline...

Avoid using clean/build on Windows while you are developing a web app
deployed onto any server... (Not just GF).

If you are using 'deploy on save', your app will be redeployed by NB and
the files will be overwritten... not deleted and replaced.

If you are not using 'deploy on save', use the Run action on your
project to trigger recompilation and deployment... only changed files
get built and they get overwritten, not deleted and replaced.

vbk

BillyRay wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1... I have a few simple web apps (jsp/java) that reference other Java project jar files. Since upgrading to NB 7.0 and GF 3,1, I've noticed that during a clean (or clean/build), I receive an error stating that NB is unable to delete the web project's copy of the referenced jar file which is located in the web project's \build\web\WEB-INF\lib folder (using in-place deployment). The error indicates that the file is in use by another process. If I exit NB and attempt to delete the jar file manually, I receive the same error from Windows. If I shutdown GF I can delete the file, so GF is obviously the process that has the file locked. However, how can one do a clean/build from within NB if the file is locked by GF? Don't recall having this problem prior to NB 7.0 and/or GF 3.1. Anyone else observe the same error?

BillyRay




Back to top
BillyRay



Joined: 18 Mar 2009
Posts: 24

PostPosted: Fri May 27, 2011 10:49 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

Thanks to everyone for the comments/suggestions. I'll certainly verify and collect the required info before filing a bug report. Seems like the easiest solution is to simply stop using in-place deployment on my dev machine. So how do I tell NB not to use in-place deployment for the local instance of GF?

Thanks!

BillyRay
Back to top
jyeary



Joined: 21 Oct 2008
Posts: 612
Location: Simpsonville, SC

PostPosted: Sat May 28, 2011 3:24 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

Vince... you are right that the issue has been around for a long time, but that does not mean it is right. An attempt to resolve it should be made in earnest. I know that a number of us use other platforms (mac for me), but the Windows population is the vast majority of developer platform choice ( I know I have been interviewing developers for the last three weeks, and yesterday I got a Linux user. I was so happy! He was also a NB user. I wanted hire him on the spot.) .

I want people to use NB and get the same great experience that I have come to expect and enjoy.

It seems like this issue has been fixed in the past. I am wrong about that? I may not have had enough coffee yet, but I feel like it is a regression.

John

On Fri, May 27, 2011 at 12:39 PM, Vince Kraemer <address-removed ([email]address-removed[/email])> wrote:
Quote:
This issue has been around for a long time.

My recommendation is going to sound like a famous punchline...

Avoid using clean/build on Windows while you are developing a web app deployed onto any server... (Not just GF).

If you are using 'deploy on save', your app will be redeployed by NB and the files will be overwritten... not deleted and replaced.

If you are not using 'deploy on save', use the Run action on your project to trigger recompilation and deployment... only changed files get built and they get overwritten, not deleted and replaced.

vbk


BillyRay wrote:
Quote:
Using WinXP-SP3, NB 7.0 and GF 3.1...
Back to top
BillyRay



Joined: 18 Mar 2009
Posts: 24

PostPosted: Sat May 28, 2011 4:25 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

I believe I've found the answer to my question of how to disable in-place deployment... Looks like in NB you have to define your local instance of GF as a remote instance (pointing to localhost). Or is there another (easier) way?

BillyRay

Quote:
Thanks to everyone for the comments/suggestions. I'll certainly verify and collect the required info before filing a bug report. Seems like the easiest solution is to simply stop using in-place deployment on my dev machine. So how do I tell NB not to use in-place deployment for the local instance of GF?
Back to top
jyeary



Joined: 21 Oct 2008
Posts: 612
Location: Simpsonville, SC

PostPosted: Sat May 28, 2011 4:31 pm    Post subject: Re: Can't delete jar during clean/build Reply with quote

I have been deploying remotely to GF on Linux so I don't have an answer. Although, I imagine that is the same as the old method of war deployment instead of in-place deployment.

John

On Sat, May 28, 2011 at 12:25 PM, BillyRay <address-removed ([email]address-removed[/email])> wrote:
Quote:
I believe I've found the answer to my question of how to disable in-place deployment...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo