Using tabs to navigate - crash on logout

Hi! I have a small project that uses AppLayout and Tab in the Drawer to navigate.
If I log in it works perfect, when I log out and then log in again, it stops working and says:
“Can’t move a node from one state tree to another. If this is intentional, first remove the node from its current state tree by calling removeFromTree”

I’m not using “@PreserveOnRefresh” wich I saw on GitHub has a similar problem, not sure why its happening the error, but I think it’s on the creation of the new page at the moment of display (i do rest call’s ok, then at the moment of add(content) its when it crash)

those are the tabs

You are mixing spring scopes - one or more of your components is annotated with the wrong scope

oh !! ok!!


in my Views i usually dont even put @Scope, its needed?

GridView (my super for all views) its just a VerticalLayout+BeforeEnterObserver

The component annotation is the problem - now your view is a singleton and only once available for all users (which doesn’t work) has informations about the available scopes for UI components


Replacing the usage of the component annotation with @SpringComponent on your views / components should solve it

Even tho the annotation is not needed on views, Vaadin allows you to inject / autowire other beans in the views even without the annotation - it’s often only added to make IDEs happy

ok perfect!