Flow 13.0.3 error when navigate back to root view. Loose the name of applic

Hi, I am rather new to Vaadin. I am having a similar problem to https://vaadin.com/forum/thread/17594578/flow-13-0-3-lost-context-prefix-when-navigate-to-root-view.
I have a java project called OpenWebVaadin02

I have 2 components a “LoginForm.java” and a “MainView.java”

The LoginForm is annotated with @Route(“”)

The MainView is annotated with @Route(“mainview”)

When I run the application (Run As - Run on Server and select a Tomcat 9 server). I get the LoginForm
correctly displayed at this URL:

http://localhost:8080/OpenWebVaadin02/

There is a button in the LoginForm that has a sentence in the click event

getUI().get().navigate(“mainview”);

And I can navigate to the MainView. It also works with his sentence:

getUI().get().navigate(MainView.class);

In the MainView there is a button that has this sentence in the click event

getUI().get().navigate(“”);

(or this one) getUI().get().navigate(LoginForm.class);

And when I press thje button from the MainView, the URL looses the name of the application
http://localhost:8080/

And I get an** HTTP Status 404 - Not Found error form the server:**

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

PS: I am using in the pom.xml:

Vaadin version 13.0.3

vaadin-cdi-version 10.1.0

servlet.version 4.0.1

weld-cdi.version 3.1.0.Final

Hi, i was having a similiar issue and for me downgrading to 13.0.2 worked. Its a temporary fix thats kinda dumb, but its a fix.

There’s also an open issue about this at https://github.com/vaadin/flow/issues/5434.

Nejc Zagrušovcem

Thank you very much for your quick answer Mr. Nejc Zagrušovcem !

Downgrading to 13.0.2 worked only in Chrome. Although it seems that the LoginWindow is loaded twice (or loaded once and refreshes the same LoginForm)

However, it does not work in Mozilla Firefox 66.0.4 nor in the the browser that Eclipse Photon uses internally…

but if first loads the LoginForm (as desired) and then it tries to load authomatically again the MainView and produces this error

org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void openadmin.ui.MainView.init() on openadmin.ui.MainView@43ad8c80

Any solution?

Thanks

I am also experiencing the double load, I’ve tried fixing it with no success. It’s annoying, but it is what it is.

After testing it, I am also having issues with Firefox, although I’m getting typescript errors, so I cant ascertain if navigate is the problem. I don’t need Firefox for my project, so I can’t really give you a fix for it.

Nejc Zagrušovcem

Thank you very much again for your quick answer Mr. Nejc Zagrušovcem !

Sorry, I must beg you pardon, as I have made an important mistake!!!

I have removed the USER_NAME variable from the Session, and got a Null Pointer Exception trying to get that variable from the session (*getWrappedSession().getAttribute(“USERNAME”) *). I have detected it now, and Routing works OK now, without any refresh nor reloads and using in Chrome, Mozilla and Eclipse internal browser without problems!

It works OK even in 13.0.2 and 13.0.3 versions.

Ximo Dante.