FilteredDockActionSource IOOBE AbstractStandardDockAction NPE

Hi,
while starting my Application sometimes the following error messages occur, the error message are not 100% reproducible. After the messages have occurred it seems that there are no further problems with docking frames. What is going wrong? What I have to do to prevent the error messages?
I use v1.1.2p7.
thanks,
martin

Exception in thread “AWT-EventQueue-0” java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at bibliothek.gui.dock.action.FilteredDockActionSource.getDockActionCount(FilteredDockActionSource.java:162)
at bibliothek.gui.dock.station.stack.action.DockActionDistributorSource.getDockActionCount(DockActionDistributorSource.java:138)
at bibliothek.gui.dock.station.stack.action.DockActionDistributorSource.setSource(DockActionDistributorSource.java:218)
at bibliothek.gui.dock.station.stack.action.DockActionDistributorSource.removeDockActionSourceListener(DockActionDistributorSource.java:210)
at bibliothek.gui.dock.themes.basic.action.buttons.ButtonPanel.set(ButtonPanel.java:274)
at bibliothek.gui.dock.themes.basic.action.buttons.ButtonPanel.set(ButtonPanel.java:236)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent.updateContent(DockActionCombinedInfoComponent.java:126)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent.setSelection(DockActionCombinedInfoComponent.java:104)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent$1.selectionChanged(DockActionCombinedInfoComponent.java:58)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.fireSelectionChanged(AbstractTabPane.java:193)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.setSelectedDockable(AbstractTabPane.java:376)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.setSelectedDockable(CombinedStackDockComponent.java:439)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.setSelectedIndex(CombinedStackDockComponent.java:433)
at bibliothek.gui.dock.StackDockStation.setFrontDockable(StackDockStation.java:766)
at bibliothek.gui.DockController$FocusControllerObserver.dockableFocused(DockController.java:1474)
at bibliothek.gui.dock.control.focus.AbstractFocusController.fireDockableFocused(AbstractFocusController.java:199)
at bibliothek.gui.dock.control.DefaultFocusController.execute(DefaultFocusController.java:223)
at bibliothek.gui.dock.control.DefaultFocusController$Request.run(DefaultFocusController.java:323)
at bibliothek.gui.dock.control.DefaultFocusController$Request.enqueue(DefaultFocusController.java:276)
at bibliothek.gui.dock.control.DefaultFocusController.grant(DefaultFocusController.java:240)
at bibliothek.gui.dock.control.DefaultFocusController.access$000(DefaultFocusController.java:55)
at bibliothek.gui.dock.control.DefaultFocusController$2.run(DefaultFocusController.java:215)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException: Unbind called too often, omit unbind and continue
at bibliothek.gui.dock.action.actions.AbstractStandardDockAction.unbind(AbstractStandardDockAction.java:154)
at bibliothek.gui.dock.themes.basic.action.buttons.ButtonPanel.set(ButtonPanel.java:269)
at bibliothek.gui.dock.themes.basic.action.buttons.ButtonPanel.set(ButtonPanel.java:236)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent.updateContent(DockActionCombinedInfoComponent.java:126)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent.setSelection(DockActionCombinedInfoComponent.java:104)
at bibliothek.gui.dock.station.stack.DockActionCombinedInfoComponent$1.selectionChanged(DockActionCombinedInfoComponent.java:58)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.fireSelectionChanged(AbstractTabPane.java:193)
at bibliothek.gui.dock.station.stack.tab.AbstractTabPane.setSelectedDockable(AbstractTabPane.java:376)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.setSelectedDockable(CombinedStackDockComponent.java:439)
at bibliothek.gui.dock.station.stack.CombinedStackDockComponent.setSelectedIndex(CombinedStackDockComponent.java:433)
at bibliothek.gui.dock.StackDockStation.setFrontDockable(StackDockStation.java:766)
at bibliothek.gui.DockController$FocusControllerObserver.dockableFocused(DockController.java:1474)
at bibliothek.gui.dock.control.focus.AbstractFocusController.fireDockableFocused(AbstractFocusController.java:199)
at bibliothek.gui.dock.control.DefaultFocusController.execute(DefaultFocusController.java:223)
at bibliothek.gui.dock.control.DefaultFocusController$Request.run(DefaultFocusController.java:323)
at bibliothek.gui.dock.control.DefaultFocusController$Request.enqueue(DefaultFocusController.java:276)
at bibliothek.gui.dock.control.DefaultFocusController.grant(DefaultFocusController.java:240)
at bibliothek.gui.dock.control.DefaultFocusController.access$000(DefaultFocusController.java:55)
at bibliothek.gui.dock.control.DefaultFocusController$2.run(DefaultFocusController.java:215)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

An der Stelle Deines Codes machst du offensichtich ein get(0) auf einer leeren Liste. Warum sie manchmal leer ist und manchmal nicht (nicht reproduzierbar), lässt sich durch Analyse des Codes feststellen, der diese Liste füllt.

Answer in english: At the designated line you obviously call get(0) on an empty list. The reason why this list sometimes is empty and sometimes not (non reproductible) can be found in the code that fills the list.

Although most likely only Beni will be able to give a definite answer here: The description, containing phrases like “sometimes” and “not 100% reproducible”, sounds like a threading issue. Is your GUI constructed on the Event-Dispatch-Thread? Are there any other threads that might interfere with the GUI?

The GUI is created on the EDT. I could not totally exclude some other interferences with the GUI. But since the stack trace only shows JRE and Docking Frames classes it will be helpful to get some hints which action could cause the problem.
thanks,
martin

By the package name “bibliothek” I was mislead into thinking that this was your own code. Sorry for that. Anyway is the source code available for the library? May be browsing it will reveal the cause.

And my guess is a possibly missing/wrong resource or config-file.

A direct websearch for “Unbind called too often, omit unbind and continue” brought http://grepcode.com/file/repo1.maven.org/maven2/org.dockingframes/docking-frames-core/1.0.8/bibliothek/gui/dock/action/actions/AbstractStandardDockAction.java (not the most recent version, though), and in doubt, the most recent version is in https://github.com/Benoker/DockingFrames/ - but this seems to be something that is hard to analyze without a more detailed knowledge of the library and its internals. I’m sure Beni will soon take care of this.

[QUOTE=marjot]The GUI is created on the EDT. I could not totally exclude some other interferences with the GUI. But since the stack trace only shows JRE and Docking Frames classes it will be helpful to get some hints which action could cause the problem.
thanks,
martin[/QUOTE]

Until now all cases of “it happens sometimes” and “not reproducable” could be explained by multi threading issues. I would suggest you ensure that there are no other threads modifying your GUI. For example: make sure the main-thread is not loading or changing the layout after you have made the JFrame of your application visible.

*** Edit ***

The most recent code of the library can be found on http://dock.javaforge.com/download.html , or on Github