Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
NullPointerException in AbstractClientConnector - help or pointer to code?
I posted my problem in the "Miscellaneous" forum but decided to post here also, since Navigator is really a framework component. Plus I can't seem to find the exact version of the source code to try and track down the problem, so I could really use some help. First the scenario:
I created a very simple application with two Views. The UI.init() creates a Navigator and registers two views via calls:
navigator.addView("", new LoginView());
navigator.addView("MainView", new MainView());
In the LoginView's Button.ClickListener()'s buttonClick() method, I call
navigator.navigateTo("MainView");
When that call is made, the NullPointerException below happens. I went to github and cloned the vaadin repository and tried to find the source code in the stack trace. But github doesn't have a 7.5.1 branch and when I switch to the 7.5 branch, the line numbers given in the stack trace don't line up with the sourcce code.
Environment: I'm using the Vaadin 7.5.1 with Java 8u51 and Tomcat 8.0.20 on a Windows 7 box.
Any help/pointers are really appreciated. I'm just getting started on this project and to get stuck so soon (the View I'm navigating to just has a single button - just to see something) is depressing. Especially since at a previous company/project, when I used Vaadin (7.2 at the time), I had no trouble whatsoever with navigation between Views.
Thanks in advance,
tom
----- NullPointerException -------
java.lang.NullPointerException
at com.vaadin.server.AbstractClientConnector.detach(AbstractClientConnector.java:628)
at com.vaadin.ui.AbstractComponent.detach(AbstractComponent.java:686)
at com.vaadin.server.AbstractClientConnector.detach(AbstractClientConnector.java:623)
at com.vaadin.ui.AbstractComponent.detach(AbstractComponent.java:686)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:568)
at com.vaadin.ui.AbstractSingleComponentContainer.setContent(AbstractSingleComponentContainer.java:150)
at com.vaadin.ui.UI.setContent(UI.java:1305)
at com.vaadin.navigator.Navigator$SingleComponentContainerViewDisplay.showView(Navigator.java:224)
at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:575)
at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:527)
at com.lenovo.sat.satweb.LoginView$1.buttonClick(LoginView.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:995)
at com.vaadin.ui.Button.fireClick(Button.java:380)
at com.vaadin.ui.Button.click(Button.java:369)
at com.vaadin.ui.Button$ClickShortcut.handleAction(Button.java:548)
at com.vaadin.event.ActionManager.handleAction(ActionManager.java:238)
at com.vaadin.event.ConnectorActionManager.handleAction(ConnectorActionManager.java:81)
at com.vaadin.event.ActionManager.handleAction(ActionManager.java:233)
at com.vaadin.event.ActionManager.handleActions(ActionManager.java:216)
at com.vaadin.ui.UI.changeVariables(UI.java:390)
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:508)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:327)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:202)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:95)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)