Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModernDocking.exception.DockableRegistrationFailureException on shutdown #230

Closed
tlf30 opened this issue Jul 3, 2024 · 2 comments
Closed
Assignees

Comments

@tlf30
Copy link

tlf30 commented Jul 3, 2024

I'm probably forgetting something (especially considering I've been using your library for a couple years now and should know how to do this) but I am getting an exception when I shutdown my app. Something to note, this is a new app that is a re-write of my old one, so the docking system has been re-implemented from the ground up.

Exception in thread "AWT-EventQueue-0" ModernDocking.exception.DockableRegistrationFailureException: No root panel for window has been registered.
	at ModernDocking.internal.DockingComponentUtils.rootForWindow(DockingComponentUtils.java:92)
	at ModernDocking.api.DockingStateAPI.getWindowLayout(DockingStateAPI.java:69)
	at ModernDocking.api.DockingStateAPI.getApplicationLayout(DockingStateAPI.java:92)
	at ModernDocking.api.AppStateAPI$1.actionPerformed(AppStateAPI.java:132)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

It looks like the exception is related to trying to persist the state of the app while it is shutting down and the root window no longer exists. This DOES NOT seem to affect the functionality of the persistence system.

I'm running the latest version as of this issue:

//Swing
    modernDockingVersion = '0.11.5'
    flatlafVersion = '3.4.1'
    miglayoutVersion = '11.3'
    beanbindingsVersion = '1.2.1'
    swingxVersion = '1.6.1'
    jlineVersion = '2.14.6'

As always, thank you so much for the awesome work and fantastic library.

EDIT:
As a note, my shutdown for the main UI looks like this:

 public void shutdown() {
        AppState.persist();
        try {
            Docking.deregisterAllDockables();
        } catch (DockableRegistrationFailureException drfe) {
            //Ignore
        }
        Docking.deregisterAllDockingPanels();
        
        //Other logic censored.....

        this.dispose();
    }

Which is similar of my old app.

@andrewauclair
Copy link
Owner

Looks like an issue I was seeing while fixing #223. That is likely the source.

@andrewauclair andrewauclair self-assigned this Jul 3, 2024
andrewauclair added a commit that referenced this issue Jul 3, 2024
Make sure that the main window root panel exists before attempting to persist its layout.
andrewauclair added a commit that referenced this issue Jul 3, 2024
Make sure that the main window root panel exists before attempting to persist its layout.
andrewauclair added a commit that referenced this issue Jul 3, 2024
Make sure that the main window root panel exists before attempting to persist its layout.
@andrewauclair
Copy link
Owner

Release 0.11.6 has been published to Maven Central with a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants