Bug when opening User sessions view with multitenancy

When opening User sessions view from a tenant the error occurs:

Caused by: java.lang.RuntimeException: Push failed
 at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:177) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:152) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.ui.UI.close(UI.java:1259) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.VaadinService$1$1.run(VaadinService.java:481) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.ui.UI.accessSynchronously(UI.java:1392) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.VaadinService$1.run(VaadinService.java:471) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_181]
 at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_181]
 at com.vaadin.server.VaadinService.runPendingAccessTasks(VaadinService.java:1861) [vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 ... 40 common frames omitted
Caused by: java.lang.ClassCastException: com.haulmont.cuba.security.entity.UserSessionEntity cannot be cast to com.haulmont.addon.sdbmt.entity.HasTenant
 at com.haulmont.addon.sdbmt.gui.app.security.session.browse.SdbmtSessionBrowser.lambda$applyTenantChanges$0(SdbmtSessionBrowser.java:34) ~[sdbmt-gui-1.1.0.jar:na]
 at com.haulmont.cuba.gui.app.security.session.browse.UserSessionsDatasource.loadData(UserSessionsDatasource.java:53) ~[cuba-gui-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:161) ~[cuba-gui-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:121) ~[cuba-gui-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refreshIfNotSuspended(CollectionDatasourceImpl.java:99) ~[cuba-gui-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.gui.data.impl.CollectionDsHelper.autoRefreshInvalid(CollectionDsHelper.java:106) ~[cuba-gui-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.web.gui.data.CollectionDsWrapper.size(CollectionDsWrapper.java:163) ~[cuba-web-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.web.gui.components.WebGroupTable$GroupTableDsWrapper.size(WebGroupTable.java:845) ~[cuba-web-6.9.7.jar:6.9.7]
 at com.vaadin.data.util.ContainerOrderedWrapper.size(ContainerOrderedWrapper.java:536) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.ui.AbstractSelect.size(AbstractSelect.java:798) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.ui.Table.doPaintContent(Table.java:3326) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.ui.Table.paintContent(Table.java:3310) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.haulmont.cuba.web.toolkit.ui.CubaTable.paintContent(CubaTable.java:828) ~[cuba-web-6.9.7.jar:6.9.7]
 at com.haulmont.cuba.web.toolkit.ui.CubaGroupTable.paintContent(CubaGroupTable.java:94) ~[cuba-web-6.9.7.jar:6.9.7]
 at com.vaadin.server.LegacyPaint.paint(LegacyPaint.java:65) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.communication.LegacyUidlWriter.write(LegacyUidlWriter.java:82) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:131) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 at com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:174) ~[vaadin-server-7.7.13.cuba.11.jar:7.7.13.cuba.11]
 ... 48 common frames omitted

Regards,

Nelson F.

Hi Nelson,

Please try to extend default UserSessionEntity class and implement HasTenant interface

Hi @evgeny.zaharchenko, hhis was done but the problem persists, administrator has no problem, but if a user of the tenant tries to open that option, the exception is presented.

@MetaClass(name = "mdsf$ExtUserSessionEntity")
public class ExtUserSessionEntity extends UserSessionEntity implements HasTenant {
    private static final long serialVersionUID = -2475867442466538108L;

    @TenantId
    @MetaProperty
    protected String tenantId;

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantId() {
        return tenantId;
    }

}

Tje @extends annotation is missing, perhaps?

Bye
Mario

thx @mario, it was that. It already opens without problem, although it does not show information of users who logged in to the tenant, but that is another post.