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 - After building with MAVEN file handles are not closed and 'clean' not possible
Summary: After building with MAVEN file handles are not closed and 'clean' not possible
Status: NEW
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P2 normal with 2 votes (vote)
Assignee: Tomas Stupka
Depends on:
Reported: 2016-10-28 11:27 UTC by bronek77
Modified: 2016-11-03 12:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

messages.log after unneeded lock (34.22 KB, application/octet-stream)
2016-11-03 12:20 UTC, bronek77

Note You need to log in before you can comment on or make changes to this bug.
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

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
( )
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.