I'm getting RouteNotFound Errors after upgrading from 1.1.x to 1.2.8.
We're setting up with 2 packages:
routes = new Routes().autoDiscoverViews("company.view.view").autoDiscoverViews("company.testroutes");
initializing our own Servlet because we need weld:
MockVaadin.setup(MockedUI::new, new WeldMockVaadinServlet(routes, weld));`
Servlet and Service look like this:
public class WeldMockVaadinServlet extends MockVaadinServlet {
private WeldInitiator _weld;
public WeldMockVaadinServlet(final Routes routes, final WeldInitiator weld) {
super(routes);
_weld = weld;
}
@SneakyThrows
@NotNull
@Override
protected VaadinServletService createServletService(@NotNull final DeploymentConfiguration deploymentConfiguration) {
CdiMockService cdiMockService = new CdiMockService(_weld, this, deploymentConfiguration);
cdiMockService.init();
return cdiMockService;
}
}
public class CdiMockService extends MockService {
private final WeldInitiator _weld;
public CdiMockService(final WeldInitiator weld, @NotNull final VaadinServlet servlet,
@NotNull final DeploymentConfiguration deploymentConfiguration) {
super(servlet, deploymentConfiguration, MockedUI::new);
System.setProperty("vaadin.i18n.provider",
"company.infrastructure.translation.TranslationProvider");
_weld = weld;
addSessionInitListener(new SessionListener());
}
@Override
protected Instantiator createInstantiator() throws ServiceException {
BeanManager beanManager = _weld.getBeanManager();
return new KaribuVaadinCDIInstantatior(this, beanManager);
}
}
When doing UI.getCurrent().navigate(DefaultView.class, param); (DefaultView is in routes, I checked in the debugger):
com.vaadin.flow.router.NotFoundException: No route found for given navigation target!
at com.vaadin.flow.router.RouteConfiguration.getUrlForTarget(RouteConfiguration.java:522)
at com.vaadin.flow.router.RouteConfiguration.getUrl(RouteConfiguration.java:476)
at com.vaadin.flow.router.RouteConfiguration.getUrl(RouteConfiguration.java:450)
at com.vaadin.flow.component.UI.navigate(UI.java:865)
I'm getting RouteNotFound Errors after upgrading from 1.1.x to 1.2.8.
We're setting up with 2 packages:
initializing our own Servlet because we need weld:
Servlet and Service look like this:
When doing
UI.getCurrent().navigate(DefaultView.class, param);(DefaultView is in routes, I checked in the debugger):