VaadinSession.getCurrent().getUIs() doesn't return all the attached UIs for

Hi everyone,
I have some troubles in getting all the UIs attached to a Vaadin session: as shown in Chapter 4.7.8 of the book:

@Push public class MyPushyUI extends UI {
protected void init(VaadinRequest request) {
setContent(new Button(“Logout”, event → {// Java 8
for (UI ui: VaadinSession.getCurrent().getUIs())
ui.access(() → {
// Redirect from the page

But it doesn’t work for me, I have 3 UIs opened but the
(Vaadin.getCurrent().getUIs()) which is iterated contains only one UI (the current) and thus only the current UI is redirected…

returns only the current UI and not all the UIs bounded to the session?

Are you sure that you have multiple UIs attached to the same SESSION?
Note that when you open the web application in another browser for example you create a new session. So when you have the web app open in 3 different browsers and each Browser has 1 UI open getUIs() will only return 1 UI.

No I use Chrome and when I start the Application I open the
and another
I have created to test this behaviour, then I click the “Logout” button inside the MyPushyUI and MyPushyUI its redirected, but the other UI is not (I don’t even get the Session Expired System message for this UI…), instead if I reload the UI that is not redirected


I get an exception in the console:

Dec 08, 2014 9:08:27 AM com.vaadin.server.communication.PushHandler onThrowable
SEVERE: Exception in push connection AtmosphereResource Cancelled: 183854b4-fae9-419e-996d-0ba9f86bc1a9
    at org.atmosphere.cpr.AtmosphereResponse.validAsyncIOWriter(
    at org.atmosphere.cpr.AtmosphereResponse.access$1100(
    at org.atmosphere.cpr.AtmosphereResponse$2.write(
    at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(
    at com.vaadin.server.communication.PushHandler$1.onStateChange(
    at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(
    at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(
    at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(
    at org.atmosphere.cpr.DefaultBroadcaster$
    at java.util.concurrent.Executors$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

Dec 08, 2014 9:08:28 AM com.vaadin.server.communication.PushHandler disconnect
SEVERE: Could not get UI. This should never happen, except when reloading in Firefox - see

However, I have logged the for cycle and the for is iterating only over a Collection with just a single item:

for (UI ui: uis) {

         ui.accessSynchronously(() -> { // Runnable implementation with a lambda expression

                  // Redirect from the page
                  System.out.println("UI class = " + ui.getClass().toString());



UI class = class com.example.application_lifecycle.MyPushyUI

Could it be another problem?