wjc272008 / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

SDK - Nifty GUI Editor #456

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On windows 7 64 bit
What steps will reproduce the problem?
1.Create a nifty gui xml file (ie from one of the examples)
2.go to the xml editor tab introduce a malformed xml statement (remove a quote 
for example)
3.go back to the preview, a popup warn you that there is an error in the file
4.go back to xml, fix the error try to save the file
the sdk seems to freeze for a short period and this error appear

"Cannot get exclusive access to 
MasterFileObject[C:\Path\to\your\nifty\file\on\your\system\newwindow.xml@8c40ee:
d1cf9e,valid=true] (probably opened for reading)"
It seems to vanish after some time...

What is the expected output? What do you see instead?
You can save the file right away after a modification

Please use labels and text to provide additional information.
here is the complete stack trace in the IDE
SEVERE:  Cannot get exclusive access to 
MasterFileObject[C:\Users\Nehon\Documents\jMonkeyProjects\TestGDE\assets\Interfa
ce\newwindow.xml@8c40ee:d1cf9e,valid=true] (probably opened for reading).

msg
Caused: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get 
exclusive access to 
MasterFileObject[C:\Users\Nehon\Documents\jMonkeyProjects\TestGDE\assets\Interfa
ce\newwindow.xml@8c40ee:d1cf9e,valid=true] (probably opened for reading).
    at org.netbeans.modules.masterfs.filebasedfs.utils.FSException.io(FSException.java:118)
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.MutualExclusionSupport.addResource(MutualExclusionSupport.java:102)
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:104)
    at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getOutputStream(FileObj.java:90)
    at org.openide.text.DataEditorSupport$Env.outputStream(DataEditorSupport.java:854)
    at org.netbeans.modules.xml.multiview.XmlMultiViewEditorSupport$XmlEnv.outputStream(XmlMultiViewEditorSupport.java:561)
    at org.openide.text.CloneableEditorSupport$1SaveAsReader.run(CloneableEditorSupport.java:1041)
    at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1422)
    at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:1097)
    at org.openide.text.DataEditorSupport.superSaveDoc(DataEditorSupport.java:556)
    at org.openide.text.DataEditorSupport$SaveImpl.run(DataEditorSupport.java:1255)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:125)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:566)
    at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:572)
    at org.openide.text.DataEditorSupport.saveDocument(DataEditorSupport.java:552)
    at org.netbeans.modules.xml.multiview.XmlMultiViewEditorSupport.doSaveDocument(XmlMultiViewEditorSupport.java:286)
    at org.netbeans.modules.xml.multiview.XmlMultiViewEditorSupport.saveDocument(XmlMultiViewEditorSupport.java:264)
[catch] at 
org.netbeans.modules.xml.multiview.XmlMultiViewDataObject$DataCache.saveData(Xml
MultiViewDataObject.java:467)
    at org.netbeans.modules.xml.multiview.XmlMultiViewEditorSupport.saveDocument(XmlMultiViewEditorSupport.java:253)
    at org.netbeans.modules.xml.multiview.XmlMultiViewDataObject$1.save(XmlMultiViewDataObject.java:102)
    at org.openide.actions.SaveAction.performAction(SaveAction.java:130)
    at org.openide.actions.SaveAction.performAction(SaveAction.java:107)
    at org.openide.actions.SaveAction$Delegate.actionPerformed(SaveAction.java:247)
    at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:231)
    at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:250)
    at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
    at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
    at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
    at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
    at org.openide.awt.GeneralAction$DelegateAction.actionPerformed(GeneralAction.java:219)
    at org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:1141)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2897)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
    at java.awt.Component.processEvent(Component.java:6044)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
    at java.awt.Component.dispatchEventImpl(Component.java:4502)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Original issue reported on code.google.com by remy.bou...@gmail.com on 23 Jan 2012 at 5:52

GoogleCodeExporter commented 9 years ago
When opening the file fails, the input stream is never closed and thus this 
error occurs. Close the input stream in a finally{} statement.

Original comment by normen667 on 23 Jan 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Yeah that's the first thing i did, but the issue still occur.
I guess it's a bit trickier than that...

Original comment by remy.bou...@gmail.com on 23 Jan 2012 at 7:27

GoogleCodeExporter commented 9 years ago
mhhh wait i was just going 
niftyObject.getPrimaryFile().getInputStream().close();
getInputStream() returns a new input stream each time.
It seems to work now that i keep a reference on the stream.

Original comment by remy.bou...@gmail.com on 23 Jan 2012 at 7:35