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 195195 - javaee-endorsed-api-6.0.jar is locked
Summary: javaee-endorsed-api-6.0.jar is locked
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 191350 197306 (view as bug list)
Depends on: 197510 198936
Blocks: 185139
  Show dependency tree
 
Reported: 2011-02-08 19:48 UTC by _ gtzabari
Modified: 2011-05-30 09:07 UTC (History)
6 users (show)

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 _ gtzabari 2011-02-08 19:48:25 UTC
Product Version: NetBeans IDE Dev (Build 201101140000)
Java: 1.6.0_25-ea; Java HotSpot(TM) 64-Bit Server VM 20.0-b08
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)

Netbeans is locking "target\endorsed\javaee-endorsed-api-6.0.jar" in Maven Web projects even though nothing is running. I believe opening the project is sufficient to lock this file, even if no server is running.

"clean and build" on the project always fails as a result.
Comment 1 Jesse Glick 2011-02-16 16:58:04 UTC
An effect of the hack used in http://jira.codehaus.org/browse/MARCHETYPES-35 I guess. The only workaround I can think of would be to make a temp copy of the endorsed JAR and add that to the in-IDE classpath rather than the original. Or try to find the original JAR in the local M2 repo.
Comment 2 David Konecny 2011-02-16 19:59:56 UTC
Jesse, have a look also at issue 188514 which was about jdk_bug_6558476.
Comment 3 Jesse Glick 2011-02-16 22:31:56 UTC
(In reply to comment #2)
> have a look also at issue 188514

I think that's a bit different - something about javac as run from builds. (Seems a poor solution because it will be wasteful when run on JDK 7 or anything else where javac properly closes the loaders it creates.)

In this case target/endorsed/*.jar are in the IDE's own ClassPath.BOOT, so the in-IDE parser opens these JARs and I suppose holds them open, making them undeletable. It is poor practice to include build products in the IDE CP for this very reason, and normally this would not happen; it is just a workaround for a limitation in Maven: http://jira.codehaus.org/browse/MNG-4752
Comment 4 Jesse Glick 2011-03-08 04:28:25 UTC
(In reply to comment #1)
> try to find the original JAR in the local M2 repo.

Will take this approach. Then the endorsed classpath will use the more correct location once (1) the project is built, (2) there is an index for the right repository (java.net in this case). Note that bug #190621 until fixed can necessitate an IDE restart.
Comment 5 Jesse Glick 2011-03-08 04:56:37 UTC
core-main #8027b148d897
Comment 6 Quality Engineering 2011-03-09 05:35:38 UTC
Integrated into 'main-golden', will be available in build *201103090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8027b148d897
User: Jesse Glick <jglick@netbeans.org>
Log: #195195: javaee-endorsed-api-6.0.jar is locked
Comment 7 ringerc 2011-04-01 06:50:58 UTC
I thought I was still hitting this issue on NetBeans 7.0 RC1 and filed this report:

http://netbeans.org/bugzilla/show_bug.cgi?id=197306

However, after seeing that the issue was already thought to be resolved in the RC1 build I did a bit more testing using SysInternals handle.exe and found something really odd:

Nokia Ovi Suite likes to open handles to libraries containing jar files and keep them open. The issue is actually Nokia Ovi Suite, not NetBeans. NokiaOviSuite.exe and nokiaserver.exe both have an open handle on:

C:\Users\Craig\Developer\classads\webui\target\classads-webui-1.0-SNAPSHOT\WEB-INF\lib

on my system. It's that, not the endorsed jar, that's causing the problem with cleaning projects now, though I certainly had the issue with the endorsed jar earlier.

For others having this or a similar problem: A short term fix is killing ovi suite. Exiting it from the taskbar isn't enough, you'll need to kill the process in task manager. A longer-term one appears (so far) to be changing the file associations so that Ovi Suite doesn't try to open jar files.
Comment 8 Jesse Glick 2011-04-04 21:51:09 UTC
*** Bug 197306 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Glick 2011-05-25 15:34:07 UTC
*** Bug 191350 has been marked as a duplicate of this bug. ***
Comment 10 stimpy 2011-05-26 18:15:37 UTC
I can reproduce this on Windows 7 .  The nokia OVI suite mentioned is not installed on this machine 

NB build 201104080000
Java version 1.6.0_21 64bit
Windows 7 Professional 6.1

To reproduce

1.)create new project 
2.) Add a framework ( choose spring MVC 3.0.2 ) 
3.) select clean and build 

The maven clean plugin 2.4.1 reports unable to delete javaee-endorsed-api-6.0.jar.

Attempting to manually delete (from windows explorer reports that file is still in use by Netbeans

Problem occurs in both local and domain accounts ( I created a new local account while troubleshooting ). 

The problem does not occur for me under OS X 10.6.

Restarting the IDE does not fix the problem.
Comment 11 stimpy 2011-05-26 18:40:07 UTC
(In reply to comment #10)
> I can reproduce this on Windows 7 .  The nokia OVI suite mentioned is not
> installed on this machine 
> 
> NB build 201104080000
> Java version 1.6.0_21 64bit
> Windows 7 Professional 6.1
> 
> To reproduce
> 
> 1.)create new project 
> 2.) Add a framework ( choose spring MVC 3.0.2 ) 
> 3.) select clean and build 
> 
> The maven clean plugin 2.4.1 reports unable to delete
> javaee-endorsed-api-6.0.jar.
> 
> Attempting to manually delete (from windows explorer reports that file is still
> in use by Netbeans
> 
> Problem occurs in both local and domain accounts ( I created a new local
> account while troubleshooting ). 
> 
> The problem does not occur for me under OS X 10.6.
> 
> Restarting the IDE does not fix the problem.

correction when attempting to delete with windows explorer  the file is reported to be in use by Java SE binary not netbeans.

Also I am running maven in offline line mode with all targets in my local repository.
Comment 12 Jesse Glick 2011-05-26 21:49:02 UTC
stimpy may be running into some unrelated bug, or some specialized subcase (e.g. broken Maven repository indices not having any match for this JAR). Please do not reopen, as the originally reported test case is no longer reproducible on XP as far as I know. Better to file a fresh bug, with any possible steps to reproduce, plus the IDE's log file (includes exact build info among other things), and the result of running the "NetBeans Project Metadata Inspector" module on the project. But first try a nightly build once one gets a fix of bug #198936, in case your problem is handled by one of the miscellaneous tweaks covered there.
Comment 13 stimpy 2011-05-27 12:20:41 UTC
I reopened this because it closely matched the original bug report ( ie same error and version of the OS ). Apologies if that was not the correct action .

I tested a "clean" install of JDK ,netbeans on a new workstation with the same error.

I will test both 6.9.1 and the nightly builds and open a new bug if the issue is not resolved in the nightly build .
Comment 14 Jesse Glick 2011-05-27 12:30:08 UTC
(In reply to comment #13)
> I will test both 6.9.1

Do not bother; the Maven integration has been substantially modified in 7.0.

> and the nightly builds

Just add yourself to CC on bug #198936; a comment will be added by the build uploader when the purported fix of that issue appears in a nightly, mentioning the build in which the fix first appears.
Comment 15 stimpy 2011-05-27 17:52:09 UTC
I did test 6.9.1 ( because I need an IDE to work with ) it works correctly even when pointed at my existing local repo.

I will add myself to 198936.

I also tested 201105240400 and that did not solve the problem. 

thanks