Vaadin page navigation

Hi everyone,
I am facing a wiered kind of problem while navigating from one page to another via Vaadin.

  1. In NavigatorUI.java(First Page)–> I just have added View
    navigator.addView(“”, new StartView());
    navigator.addView(MAINVIEW, new MainView());
    and no “navigateTo()” is used , even then it is moving from NavigatorUI.java to StartView.java.
  2. Now , in 2nd page i.e StartView.java I have
    I am invoking navigator.navigateTo(MAINVIEW)–> 3rd page on button click, but it throws the following error:-

SEVERE:
com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:170)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
Sample Code:-----

NavigatorUI.java
navigator = new Navigator(this, this);
// Create and register the views
navigator.addView(“”, new StartView());
navigator.addView(MAINVIEW, new MainView());

StartView.java
public class StartView extends VerticalLayout implements View {
Navigator navigator;
protected static final String MAINVIEW = “main”;
public StartView() {
setSizeFull();
System.out.println(“start view entered”);
Button button = new Button(“Go to Main View”,
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
navigator.navigateTo(MAINVIEW);
}
});

MainView.java
public class MainView extends VerticalLayout implements View {

@Override
public void enter(ViewChangeEvent event) {
	// TODO Auto-generated method stub
	System.out.println("Mian view entered");
	
}

}

hi, did you find a solution?