A connector with id 315 is already registered!

Hi All,

I am new to vaadin framework, facing a problem with vaadin sesions, i am getting an error
SEVERE: java.lang.RuntimeException: A connector with id 315 is already registered!

my scenario is, I have started the server at the time of starting server int() method is called and its created a vaadin wrapped session,
and i have logged in with one user and navigated to some pages, then logged out the user, then i logged in with another user and when i navigate to the same page i am getting this error.

what i have observed is, when user click on logout it is closing the session and navigation to login page, here it is calling init() again and creating a new a session.
at the time of starting the server its creating two sessions, so one is getting closed after logout and other is still there.

i would like to know when actually the vaadin session creates?
is it before the applilcation login or before login?
in my case before userr login init() called and session is getting created after click on login it is just authenticating user is it correct way or not?

@Override
protected void init(VaadinRequest request) {
WrappedSession session = request.getWrappedSession();
HttpSession httpSession = ((WrappedHttpSession) session).getHttpSession();
System.out.println(“httpSession.getId()…:”+httpSession.getId());
ServletContext servletContext = httpSession.getServletContext();

}

logout code:

MenuBar.MenuItem logout = menuBar.addItem(“Log Out: " + userName, new MenuBar.Command() {
@Override
public void menuSelected(MenuBar.MenuItem selectedItem) {
LoneUI current = (LoneUI) UI.getCurrent();
SecurityContextHolder.clearContext();
VaadinSession.getCurrent().setAttribute(“user”, null);
Page.getCurrent().setLocation(”/lone/loginView");
UI.getCurrent().getSession().getSession().invalidate();
UI.getCurrent().getSession().close();
}
});

could you help me how we can open and close the seeeions in an efficient way without this kind of errors.

Thanks in advance!
Lucky