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 254267 - Annotations FileAlreadyLockedExceptions with saveAnnotationType and parse
Summary: Annotations FileAlreadyLockedExceptions with saveAnnotationType and parse
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-11 12:18 UTC by Exceptions Reporter
Modified: 2018-04-03 08:26 UTC (History)
20 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219085


Attachments
stacktrace (3.93 KB, text/plain)
2015-08-11 12:18 UTC, Exceptions Reporter
Details
stacktrace (4.00 KB, text/plain)
2016-04-05 15:32 UTC, Tomas Stupka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2015-08-11 12:18:27 UTC
This bug was originally marked as duplicate of bug 251434, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 8.1 Beta (Build 201508041349)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.31-b07, Java(TM) SE Runtime Environment, 1.8.0_31-b13
OS: Windows 8

User Comments:
vriha: closing Options dialog with OK after previously saving changes with Apply button

GUEST: Changing multiple settings

jskrivanek: Appeared while verifying bug 251398:

- create java project
- added lines to main class

        for (int i = 0; i < 10; i++) System.out.println("aaa");
        if (true) System.out.println("aaa");

- open Tools, Options, Editor, Hints
- tick Braces
- click Apply
- click OK

GUEST: When closing the options, this exception has raised.

vercinstex: checking php function and options

GUEST: .

GUEST: <??????? ???????? ???????? ??? ???? ??? ???????????????>open setings

bennyn: Selected PHP interpreter from "C:\xampp\php\php.exe" (using XAMPP 1.8.3) which caused the bug.

MackSix: Went to Tools>>Options>>General and select Chrome Web Browser and clicked Apply button.

GUEST: Bug applying Norway Today theme with some files (3) opened

soldatov: close Options window

GUEST: error

lehel: Tools-Options-Prox Settings: No Proxy -> Apply

misterm: .

abalint21: Changed C++ code completion and hit apply

GUEST: I set the Proxy to none

mentlicher: Closed modified global options.

GUEST: Saving settings.

GUEST: <???????????????>?? ????




Stacktrace: 
java.lang.Exception
   at org.openide.filesystems.StreamPool$NotifyOutputStream.<init>(StreamPool.java:368)
   at org.openide.filesystems.StreamPool.createOutputStream(StreamPool.java:134)
   at org.openide.filesystems.AbstractFileObject.getOutputStream(AbstractFileObject.java:254)
   at org.openide.filesystems.AbstractFileObject.getOutputStream(AbstractFileObject.java:236)
   at org.openide.filesystems.MultiFileObject.getOutputStream(MultiFileObject.java:692)
   at org.openide.filesystems.MultiFileObject.getOutputStream(MultiFileObject.java:692)
Comment 1 Exceptions Reporter 2015-08-11 12:18:31 UTC
Created attachment 155266 [details]
stacktrace
Comment 2 Jaroslav Havlin 2015-08-11 14:50:17 UTC
An output stream for file "Editors/AnnotationTypes/OtherThread_PC.xml" was created:
o.n.m.editor.options.AnnotationTypesFolder.saveAnnotationType(AnnotationTypesFolder.java:222)

Another thread tried to create input stream for the same file, but failed, because it stayed locked for more than two seconds (hard drive was probably busy at that moment):
o.n.m.editor.options.AnnotationTypeProcessor.parse(AnnotationTypeProcessor.java:178).

I'm not sure how this should be fixed. Increasing the timeout globally is risky (and this case is more frequent than other FileAlreadyLockedExceptions).
Maybe some synchronization/semaphore could be added to AnnotationTypesFolder/AnnotationTypeProcessor.

Reassigning to editor/Options. Please evaluate. Thanks.
Comment 3 Milutin Kristofic 2015-08-18 12:49:33 UTC
There is similar issue with Annotations in Bug #242179. I am trying to fix this issue, I have made small fix in Bug #251434, then there was fix in #254483 . If these fixes will not help, I would need to synchronize parse and saveAnnotation.
Comment 4 Tomas Stupka 2016-04-05 15:32:26 UTC
Created attachment 159124 [details]
stacktrace

changed "fonts & colors" profile to "norway today"