Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

getUI().get().access throws and exception

Ruben Fanjul
4 years ago Nov 13, 2018 10:15am
Ruben Fanjul
4 years ago Nov 13, 2018 12:01pm
Gilberto Torrezan Filho
4 years ago Nov 15, 2018 11:38am

Hi Ruben,

This is probably caused by a message being delivered to an UI that is not attached anymore - in other words, the user closed the tab.

One way to avoid the issue is to listen to detach events from your UI and unregister it from receiving further messages.

You can also catch the exception when calling access and unregister it there.

In newer Flow versions, you can call accessLater(SerializableRunnable accessTask, SerializableRunnable detachHandler) instead. The detachHandler callback is then executed when the UI is detached, avoiding the exception.

-- Gilberto

Ruben Fanjul
4 years ago Nov 15, 2018 2:35pm
Gilberto Torrezan Filho
4 years ago Nov 15, 2018 2:49pm
Giovanni Lovato
3 years ago Sep 27, 2019 12:04pm