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.
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)
Created attachment 136579 [details] stacktrace
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.
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
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 ?
Fixed in http://hg.netbeans.org/jet-main/rev/94e7ced1c896
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