Exception in CControl.readXML(File)

1.1.0p4 / Eclipse Theme / Glass Extension

Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 7
at bibliothek.gui.dock.station.stack.tab.layouting.TabsLayoutBlock.getTabsOrderedByImportance(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.layouting.LineTabsLayoutBlock.getSizes(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout$Layout.listLayouts(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout$Layout.layout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout.layout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.doLayout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.discardComponentsAndRebuild(Unknown Source)
at bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane.updateTabPainter(Unknown Source)
at bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane$1.valueChanged(Unknown Source)
at bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane$1.valueChanged(Unknown Source)
at bibliothek.gui.dock.util.PropertyValue.setProperties(Unknown Source)
at bibliothek.gui.dock.util.PropertyValue.setProperties(Unknown Source)
at bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabPane.setController(Unknown Source)
at bibliothek.gui.dock.StackDockStation.setController(Unknown Source)
at bibliothek.gui.dock.control.DockRegister.register(Unknown Source)
at bibliothek.gui.dock.control.DockRegister$1.handleDockable(Unknown Source)
at bibliothek.gui.dock.util.DockUtilities.visitDockable(Unknown Source)
at bibliothek.gui.dock.util.DockUtilities.visit(Unknown Source)
at bibliothek.gui.dock.control.DockRegister.add(Unknown Source)
at bibliothek.gui.dock.control.DockRegister.access$400(Unknown Source)
at bibliothek.gui.dock.control.DockRegister$StationListener.addDockable(Unknown Source)
at bibliothek.gui.dock.control.DockRegister$StationListener.fire(Unknown Source)
at bibliothek.gui.dock.control.DockRegister.setStalled(Unknown Source)
at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(Unknown Source)
at bibliothek.gui.dock.facile.mode.LocationModeManager.runLayoutTransaction(Unknown Source)
at bibliothek.gui.dock.common.intern.CDockFrontend.setSetting(Unknown Source)
at bibliothek.gui.DockFrontend.readXML(Unknown Source)
at bibliothek.gui.dock.common.CControl$8.readXML(Unknown Source)
at bibliothek.gui.dock.support.util.ApplicationResourceManager.readXML(Unknown Source)
at bibliothek.gui.dock.common.CControl.readXML(Unknown Source)
at bibliothek.gui.dock.common.CControl.readXML(Unknown Source)

I also got repeatedly:

Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: dockable not child of this pane
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.putOnTab(Unknown Source)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.putOnTab(Unknown Source)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.putOnTab(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.layouting.TabsLayoutBlock.setLayout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout$Layout$PaneLayout.apply(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout$Layout.layout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.MenuLineLayout.layout(Unknown Source)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.doLayout(Unknown Source)
at bibliothek.gui.dock.station.stack.CombinedStackDockContentPane.doLayout(Unknown Source)
at java.awt.Container.validateTree(Container.java:1507)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validate(Container.java:1480)
at java.awt.Window.dispatchEventImpl(Window.java:2476)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
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)

However, sometimes everything is displayed as expected despite of the excetions whereas sometimes visible error appear as depicted in the screenshot.

There is a good chance that the second error is caused by the first one.

Is the first error happening all the time or at random? If it is at random, try calling „readXML“ from the EventDispatcherThread.

This does not happen with my test application. I’ll try to reproduce the bug anyway, but do you do anything special? Some listeners modifying the Dockables while loading the layout or something like that?

Are you searching for bugs? Most of the things you report are completely new to me… good thing you don’t use a „stable“ version :stuck_out_tongue:

Hi Beni,

the problem occured everytime when restoring outside the AWT-EventQueue. I have changed it to EventQueue.invokeLater() and it works fine now.

Currently, we are still in the development phase, but I assume that we will start testing for earnest with your next build :wink:

Our application should still be quite straightforward, we are currently only using CControl with the primary ContentArea and additional ContentAreas, DefaultSingleCDockables and CDockableStateListener. But if it would be possible to engage you for professional services or support, we would not hesitate to do so :slight_smile:

[QUOTE=Karsten]the problem occured everytime when restoring outside the AWT-EventQueue. I have changed it to EventQueue.invokeLater() and it works fine now.
[/quote]
Unfortunately the framework is not really capable of multi-threading. And since the framework combines several Swing Components chances for AWT-events and code not executed in the EDT to crash is quite high.

Currently, we are still in the development phase, but I assume that we will start testing for earnest with your next build :wink:

Ok. The next build 1.1.0p5 will be a bit rushed to get all the fixes and feature requests online. But after that there is a feature freeze and I plan do to some real testing for 1.1.0p6.

But if it would be possible to engage you for professional services or support, we would not hesitate to do so :slight_smile:

Sorry, I don’t have the time for that. But I try to answer questions in this forum at least once a day.

I got a new error with 1.1.0p6 / Eclipse Theme / Glass Extension. The XML file is attached.

Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: placeholders does contain a null value
at bibliothek.gui.dock.station.support.PlaceholderMap$PlaceholderKey.(PlaceholderMap.java:987)
at bibliothek.gui.dock.station.support.PlaceholderMap$PlaceholderKey.shrink(PlaceholderMap.java:1061)
at bibliothek.gui.dock.station.support.PlaceholderMap.validate(PlaceholderMap.java:503)
at bibliothek.gui.dock.station.support.PlaceholderMap.setPlaceholderStrategy(PlaceholderMap.java:457)
at bibliothek.gui.dock.station.support.PlaceholderMap.filter(PlaceholderMap.java:374)
at bibliothek.gui.dock.station.flap.FlapDockStationFactory.setLayout(FlapDockStationFactory.java:106)
at bibliothek.gui.dock.station.flap.FlapDockStationFactory.setLayout(FlapDockStationFactory.java:58)
at bibliothek.gui.dock.layout.PredefinedDockSituation$PreloadFactory.setLayout(PredefinedDockSituation.java:650)
at bibliothek.gui.dock.layout.PredefinedDockSituation$PreloadFactory.layout(PredefinedDockSituation.java:705)
at bibliothek.gui.dock.layout.PredefinedDockSituation$PreloadFactory.layout(PredefinedDockSituation.java:587)
at bibliothek.gui.dock.layout.DockSituation.convert(DockSituation.java:383)
at bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy.applyLayout(DefaultLayoutChangeStrategy.java:297)
at bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy.setLayout(DefaultLayoutChangeStrategy.java:97)
at bibliothek.gui.DockFrontend.setSetting(DockFrontend.java:1443)
at bibliothek.gui.dock.common.intern.CDockFrontend.access$001(CDockFrontend.java:48)
at bibliothek.gui.dock.common.intern.CDockFrontend$1.run(CDockFrontend.java:162)
at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:486)
at bibliothek.gui.dock.facile.mode.LocationModeManager.runLayoutTransaction(LocationModeManager.java:458)
at bibliothek.gui.dock.common.intern.CDockFrontend.setSetting(CDockFrontend.java:160)
at bibliothek.gui.DockFrontend.readXML(DockFrontend.java:1873)
at bibliothek.gui.dock.common.CControl$8.readXML(CControl.java:766)
at bibliothek.gui.dock.support.util.ApplicationResourceManager.readXML(ApplicationResourceManager.java:174)
at bibliothek.gui.dock.common.CControl.readXML(CControl.java:2543)
at bibliothek.gui.dock.common.CControl.readXML(CControl.java:2556)

Thanks a lot. I was hoping this exception would be thrown by one of my tests, but it never happened. But it prevents another exception that would be even more catastrophic. I’ll fix this ASAP - well, in the evening.

[Edit: and it seems to be a very stupid bug. Just reading the wrong variable… ::slap1 ]

I’m afraid I dicovered another one with 1.1.0p6e / Eclipse Theme / Glass Extension:

Exception in thread “AWT-EventQueue-0” java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$ValueIterator.next(HashMap.java:822)
at bibliothek.gui.DockFrontend.clean(DockFrontend.java:1677)
at bibliothek.gui.DockFrontend$Internals.clean(DockFrontend.java:2142)
at bibliothek.gui.dock.frontend.DefaultLayoutChangeStrategy.setLayout(DefaultLayoutChangeStrategy.java:94)
at bibliothek.gui.DockFrontend.setSetting(DockFrontend.java:1445)
at bibliothek.gui.dock.common.intern.CDockFrontend.access$001(CDockFrontend.java:48)
at bibliothek.gui.dock.common.intern.CDockFrontend$1.run(CDockFrontend.java:162)
at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:486)
at bibliothek.gui.dock.facile.mode.LocationModeManager.runLayoutTransaction(LocationModeManager.java:473)
at bibliothek.gui.dock.common.intern.CDockFrontend.setSetting(CDockFrontend.java:160)
at bibliothek.gui.DockFrontend.readXML(DockFrontend.java:1875)
at bibliothek.gui.dock.common.CControl$8.readXML(CControl.java:786)
at bibliothek.gui.dock.support.util.ApplicationResourceManager.readXML(ApplicationResourceManager.java:174)
at bibliothek.gui.dock.common.CControl.readXML(CControl.java:2615)
at bibliothek.gui.dock.common.CControl.readXML(CControl.java:2628)

Interesting. There is only one explanation: while the new layout was applied, a root station was added or removed from the DockFrontend. I will make the methods a bit more resistant against this kind of concurrent modification, but I also bet the root station was not added / removed by the framework alone :slight_smile:

You are right - as always :wink:

We have identified the problematic code and embedded into the EventQueue like the other code.