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 232128 - java.io.IOException: Invalid lock [org.openide.filesystems.FileLock@39559208]. Expected [null].
Summary: java.io.IOException: Invalid lock [org.openide.filesystems.FileLock@39559208]...
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2013-07-02 09:36 UTC by Milan Kuchtiak
Modified: 2013-07-16 02:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 152011


Attachments
stacktrace (1.55 KB, text/plain)
2013-07-02 09:36 UTC, Milan Kuchtiak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kuchtiak 2013-07-02 09:36:22 UTC
Build: NetBeans IDE Dev (Build 20130702-13938d968296)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Linux

User Comments:
mkuchtiak: Created Rest Resource (Use Jersey Specific feature checkbox checked) in Tomcat web application




Stacktrace: 
java.io.IOException: Invalid lock [org.openide.filesystems.FileLock@39559208]. Expected [null].
   at org.netbeans.modules.xml.multiview.XmlMultiViewDataObject$DataCache.testLock(XmlMultiViewDataObject.java:631)
   at org.netbeans.modules.xml.multiview.XmlMultiViewDataObject$DataCache.setData(XmlMultiViewDataObject.java:453)
   at org.netbeans.modules.j2ee.ddloaders.multiview.DDMultiViewDataObject$ModelSynchronizer.updateDataFromModel(DDMultiViewDataObject.java:268)
   at org.netbeans.modules.xml.multiview.XmlMultiViewDataSynchronizer.updateData(XmlMultiViewDataSynchronizer.java:264)
   at org.netbeans.modules.j2ee.ddloaders.multiview.DDMultiViewDataObject$ModelSynchronizer.updateData(DDMultiViewDataObject.java:256)
   at org.netbeans.modules.j2ee.ddloaders.multiview.DDMultiViewDataObject.writeModel(DDMultiViewDataObject.java:139)
Comment 1 Milan Kuchtiak 2013-07-02 09:36:24 UTC
Created attachment 136579 [details]
stacktrace
Comment 2 Svata Dedic 2013-07-10 07:09:58 UTC
Sorry I am not that familiar with various JEE artifact and could not find anything related to Jersey. Could you please provide reproduction steps ? Thanks.
Comment 3 Milan Kuchtiak 2013-07-10 13:11:34 UTC
Steps to reproduce:

- New Web Application [Java EE 6], 
- set GlassFish 3.1 server (as target web server)
- Wizard -> new -> Web Services -> Restful Web Services From Patterns
- check "Use Jersey Specific feature" checkbox
- finish Wizard

Or may be easier:

- New Web Application [Java EE 5],
- set Tomcat 6 or Tomcat 7 server (as target web server)
- Wizard -> new -> Web Services -> Restful Web Services From Patterns
- finish Wizard
Comment 4 Svata Dedic 2013-07-12 13:18:12 UTC
Both locks (the one checked by testLock and the originally obtained from waitForLock) originate from XmlMultiViewDataObject. However code in XMVDO seems to missing synchronization on the DataCache; so if a competing thread obtains a lock it may be possible that a different lock gets referenced in the DataCache thus causing IAE in a testLock() call later.

BTW - I cannot reproduce the defect, could you please try to find some higher probability scenario ?
Comment 5 Svata Dedic 2013-07-12 13:43:53 UTC
Fixed in http://hg.netbeans.org/jet-main/rev/94e7ced1c896
Comment 6 Quality Engineering 2013-07-16 02:37:58 UTC
Integrated into 'main-silver', will be available in build *201307152300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/94e7ced1c896
User: Svata Dedic <sdedic@netbeans.org>
Log: #232128: synchronized DataCache locking to prevent multi-thread races