vaadin + spring ( problems)

Hello,

Got small problems with @UIScope… got error: Can’t move a node from one state tree to another.

When i use

@Route(value = "administrator", layout = ParentView.class, absolute = true)
public class AdministratorView extends VerticalLayout {}

public class ParentView extends VerticalLayout implements RouterLayout {

    @Autowired
    private Menu menu;

    @PostConstruct
    public void init(){
            add( menu);
    }
}

@SpringComponent
@UIScope
public class Menu extends VerticalLayout {

	 @Autowired
	 private User user;
}

@Entity
@SpringComponent
@UIScope
public class User {}

Someone know what i making wrong here? When i inject Menu from AdministratorView class everything work fine…

Hi, I am using injection with Weld CDI (and Tomcat, not an application server) and I have to use ONLY the Vaadin provided annotations for CDI. I cannot use @Named, @SessionScoped and so on.

Maybe you are using Spring specific annotations that cannot be used in Vaadin.

Have a look at [Vaadin CDI]
(https://vaadin.com/docs/flow/cdi/tutorial-cdi-basic.html)

No more suggestions.