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 268728

Summary: After building with MAVEN file handles are not closed and 'clean' not possible
Product: projects Reporter: bronek77 <bronek77>
Component: MavenAssignee: Tomas Stupka <tstupka>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: messages.log after unneeded lock

Description bronek77 2016-10-28 11:27:21 UTC
I'm building maven projects with about 16 projects open.
Very often (2-3 times a day) I cannot clean one of the projects - netbeans64.exe keeps open handles to jar files.  It did not happen in 8.0 (the same projects were built).
I have to close the handle myself using system tools or close/open netbeans.
There are no IDE activities like project parsing/processing visible during that.
Comment 1 Tomas Stupka 2016-10-31 13:05:17 UTC
would need a bit more information:
- exactly what netbeans build do you use
- what are those jar held - from the netbeans buidl, your project deps from .m2/repository, ... ?

- reproduce your problem and attach your messages.log file

- what does it mean you cannot clean - is there any error message? 
- also attach text from the output view in netbeans after such an clean
Comment 2 bronek77 2016-10-31 14:30:21 UTC
Netbeans 8.2, Build 201609300101

The jars are the project output jars.  I cannot clean means I get an error message telling I cannot clean, I also cannot delete jars manually (not only from IDE but also using os tools) and when I check file handles in system tools I see netbeans64.exe keeps the files locked.  So - the text output is just the same as if you had some files in 'target' dir open and try to clean a project.  

The problem is not in the clean process, it's in the fact that netbeans64.exe keeps the jar file locked (I can see it and release the lock using sysinternals Process Explorer).

I'll try to reproduce it and will send messages.log file.
Comment 3 Tomas Stupka 2016-10-31 15:28:44 UTC
thanks

it would be great if you could find the necessary steps to reproduce,
or eventually you can also create a heapdump after the problem appeared
( http://wiki.netbeans.org/FaqMemoryDump )
Comment 4 Tomas Stupka 2016-10-31 15:40:56 UTC
also, when the problem happens:
- is the only way to fix it to release externally, or does it help to wait a while?
- are there any background tasks running in the ide - e.g. indexing?
Comment 5 bronek77 2016-11-03 12:20:28 UTC
Created attachment 162744 [details]
messages.log after unneeded lock

No background processes (like indexing) are running.
Waiting does not help.  The only way is to do it externally. 

I think it happens (not always but it did not happen for a day when I didn't do it) after I open the generated jars (the ones that are being locked) in IDE to see their content.  Closing all files, closing the jar tree (in "files" window) does not help.