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 250385 - IDE does not close jar file
Summary: IDE does not close jar file
Status: RESOLVED INCOMPLETE
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 01:02 UTC by bht
Modified: 2015-07-07 11:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2015-02-12 01:02:04 UTC
When I run a Maven project Clean and Build on a jar project, then the clean fails with this error:

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project <my-project-name>: Failed to clean project: Failed to delete (my-project-name-path>\target\<my-jar>.jar -> [Help 1]

When I try to delete this file in Windows 7 Explorer, I am getting the error:

"The action can't be completed because the file is open in NetBeans IDE"


How did I get there?

I opened a jar file in the IDE's Files window to see whether it contained an @Entity class file that was not created by Hibernate although it was coded in persistence.xml.
I guess I saw this first problem (the tomcat problem not the IDE problem) because my Tomcat server was still running, having locked that jar file. The IDE opened the jar file without problems in the Files window, letting me browse it and see the class that was not missing.
So I undeployed the web app and closed the jar file int the IDE's File window.

What I would expect.

1) I would expect that the IDE closes the jar file as soon as possible. This did not happen.
2) I would expect that the IDE closes the jar file at least when the user has finished using it. This did not happen.
3) If there is still a problem to implement 1) or 2), then I would expect that the user can close the jar file via some IDE command action. I cannot see how the IDE supports this.

At present, I have only one choice: Close and re-open the IDE.

I remember that this issue existed before, and I hope I can provide a reference to this.
Comment 1 bht 2015-02-12 04:12:51 UTC
Related: Bug 216450
Comment 2 Jaroslav Havlin 2015-03-06 14:59:42 UTC
I tried to reproduce the bug, but everything worked fine for me (Windows 7 64bit, jdk7u51).
I was able to externally delete JAR file that was opened (all its folders expanded) in the IDE's Files view, and even some of contained files were opened in editor (as read-only).
(The JAR file's stream is closed as soon as all necessary data are read.)

Wasn't the file locked by Tomcat? Maybe application undeploying is not sufficient and the whole server needs to be stopped to release all resources. (I didn't try this.)
Can you please check whether stopping the server helps? Thank you.
Comment 3 Jaroslav Havlin 2015-07-07 11:35:46 UTC
> Can you please check whether stopping the server helps?
Closing for now. Please reopen the issue if you can provide some additional information.
Thank you.