Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
cannot push because UI is detached
Hi all,
Lately I’ve been getting an exception in my code but it is only thrown sometimes when I try to make a push to the UI.
UI.getCurrent( ).access( ( ) ->
UI.getCurrent( ).push( );
);
com.vaadin.ui.UIDetachedException
at com.vaadin.ui.UI.access(UI.java…)
at ...
Apparently it’s telling that the UI is no longer attached to a VaadinSession. Can it be either because UI’s not alive or session doesn’t exist anymore? I mean basically my questions are:
Why am I getting the exception, why is the UI getting detached?
i.e. What causes the UI to be detached, since I’ve been reading that UIs are open on the client side and send a regular heartbeat to the server to indicate they are still alive, even though there is no ongoing user interaction.
And my session is NOT configured to timeout (default behaviour).
How can I treat it? (even if the cause can't be determined). Since my process goes on executing on the background, but my UI is dead, how can I restore it, or attach it to the session.
Any ideas?
Regards,
Enrique
Pd. I can copypaste specific parts of my code if it helps