Search code examples
javanetbeansnetbeans-7netbeans-platform

Attempt to obtain DataObject for <FileObject> from EDT / Ineffective since #199391 was implemented


What does "Attempt to obtain DataObject for from EDT" means in this netbeans platform application stacktrace:

[INFO] INFO [org.netbeans.ui.metrics.projects]: USG_PROJECT_OPEN
[INFO] WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator at org.netbeans.modules.masterfs.providers.Attributes.getRootForAttributes(Attributes.java:104)
[INFO] WARNING [org.openide.loaders.FolderChildren..tmp.lol.Wonderland.scenes]: Attempt to obtain DataObject for /tmp/lol/Wonderland/scenes/Alice.inc@d30e0395:b749a5 from EDT
[INFO] INFO [org.openide.loaders.FolderChildren..tmp.lol.Wonderland.scenes]: Ineffective since #199391 was implemented
[INFO] java.lang.Exception: Find for /tmp/lol/Wonderland/scenes/Alice.inc@d30e0395:b749a5
[INFO]  at org.openide.loaders.FolderChildren$DelayedNode.convert(FolderChildren.java:451)
[INFO]  at org.openide.loaders.FolderChildren$DelayedNode.convert(FolderChildren.java:399)
[INFO]  at org.openide.util.lookup.InstanceContent$ConvertingItem.getInstance(InstanceContent.java:316)
[INFO]  at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:421)
[INFO]  at org.openide.nodes.FilterNode$FilterLookup.lookup(FilterNode.java:2114)
[INFO]  at org.openide.nodes.FilterNode$FilterLookup.lookup(FilterNode.java:2114)
[INFO]  at povray.projects.PovRayProxyChildren.createNodes(PovRayProxyChildren.java:30)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterNodeEntry.nodes(FilterNode.java:1895)
[INFO]  at org.openide.nodes.EntrySupport$Lazy$EntryInfo.getNode(EntrySupport.java:1645)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterLazySnapshot.get(FilterNode.java:1741)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterNodeEntry.nodes(FilterNode.java:1886)
[INFO]  at org.openide.nodes.EntrySupport$Lazy$EntryInfo.getNode(EntrySupport.java:1645)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterLazySnapshot.get(FilterNode.java:1741)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterNodeEntry.nodes(FilterNode.java:1886)
[INFO]  at org.openide.nodes.EntrySupport$Lazy$EntryInfo.getNode(EntrySupport.java:1645)
[INFO]  at org.openide.nodes.FilterNode$Children$LazySupport$FilterLazySnapshot.get(FilterNode.java:1741)
[INFO]  at org.openide.nodes.EntrySupport$Lazy$LazySnapshot.get(EntrySupport.java:1871)
[INFO]  at org.openide.nodes.EntrySupport$Lazy$LazySnapshot.get(EntrySupport.java:1858)
[INFO]  at org.openide.explorer.view.VisualizerChildren.getChildAt(VisualizerChildren.java:127)
[INFO]  at org.openide.explorer.view.VisualizerNode.getChildAt(VisualizerNode.java:321)
[INFO]  at javax.swing.tree.DefaultTreeModel.getChild(DefaultTreeModel.java:156)
[INFO]  at javax.swing.tree.FixedHeightLayoutCache$VisibleFHTreeStateNodeEnumeration.nextElement(FixedHeightLayoutCache.java:1506)
[INFO]  at javax.swing.tree.FixedHeightLayoutCache$VisibleFHTreeStateNodeEnumeration.nextElement(FixedHeightLayoutCache.java:1461)
[INFO]  at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayoutCache.java:228)
[INFO]  at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:1820)
[INFO]  at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1921)
[INFO]  at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:1909)
[INFO]  at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
[INFO]  at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
[INFO]  at org.openide.explorer.view.TreeView$ExplorerScrollPaneLayout.layoutContainer(TreeView.java:1823)
[INFO]  at java.awt.Container.layout(Container.java:1421)
[INFO]  at java.awt.Container.doLayout(Container.java:1410)
[INFO]  at java.awt.Container.validateTree(Container.java:1507)
[INFO]  at java.awt.Container.validate(Container.java:1480)
[INFO]  at org.openide.explorer.view.TreeView.access$101(TreeView.java:151)
[INFO]  at org.openide.explorer.view.TreeView$3.run(TreeView.java:683)
[INFO]  at org.openide.util.Mutex.readAccess(Mutex.java:365)
[INFO]  at org.openide.util.Mutex$1R.run(Mutex.java:1307)
[INFO]  at org.openide.nodes.Children$ProjectManagerDeadlockDetector.execute(Children.java:1920)
[INFO]  at org.openide.util.Mutex.doWrapperAccess(Mutex.java:1326)
[INFO]  at org.openide.util.Mutex.readAccess(Mutex.java:354)
[INFO]  at org.openide.explorer.view.TreeView.validate(TreeView.java:681)
[INFO]  at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:670)
[INFO]  at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1635)
[INFO]  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[INFO]  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
[INFO]  at java.awt.EventQueue.access$000(EventQueue.java:84)
[INFO]  at java.awt.EventQueue$1.run(EventQueue.java:602)
[INFO]  at java.awt.EventQueue$1.run(EventQueue.java:600)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
[INFO]  at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
[INFO]  at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:162)
[INFO]  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
[INFO]  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
[INFO]  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
[INFO]  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
[INFO]  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[INFO]  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

? How to fix it? It happens when i am opening to open special project type (.pov) with my application. It doesn't hurt anything ,but floods the terminal output with same message for each of .pov-project files.

EDIT1

Aha, after some research i found that EDT means "Event Dispatcher Thread", where accessing for DataObjects for some reason is prohibited. What reason of such prohibition and how do i correctly test if node represent a hidden file on FS? How do i create seperate thread for it correctly?


Solution

  • The reason for the prohibition is that this could cause IO to disk and thus should be avoided on EDT. Otherwise the UI might freeze.

    For Information about threading and its correct usage see: http://docs.oracle.com/javase/tutorial/uiswing/concurrency/worker.html

    To know whether the file is hidden or not you will need to access java.io.File.

    To access the file you will need to do:

    FileObject fo = DATAOBJECT.getPrimaryFile();
    File = FileUtil.toFile(fo)
    

    you will need to add error code.