When I add a new view, it is detected and added. When I try to edit an existing view, it fails because of a non-unique exception.
I was looking at this guide for inspiration https://vaadin.com/blog/developing-without-server-restarts and the newest comment about being able to skip the -XXaltjvm
and -javaagent
steps but I think almost all of the steps might not be needed anymore?
The only configurations I made was pointing the maven JRE to dcevm-11.0.1+8
.
Then I add the TestView
route and it logs fine and the new route exist with expected content:
HOTSWAP AGENT: 00:35:33.865 INFO (org.hotswap.agent.plugin.vaadin.VaadinPlugin) - HotSwapAgent dynamically added new route to com.example.test.spring.TestView
Then I do something small like change the value of the text inside a label in that new view and I get:
HOTSWAP AGENT: 00:35:54.597 INFO (org.hotswap.agent.plugin.vaadin.VaadinPlugin) - HotSwapAgent dynamically added new route to com.example.test.spring.TestView
HOTSWAP AGENT: 00:35:54.599 ERROR (org.hotswap.agent.plugin.vaadin.VaadinPlugin) - null
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hotswap.agent.plugin.vaadin.VaadinPlugin.addToRouterConfiguration(VaadinPlugin.java:234)
at org.hotswap.agent.plugin.vaadin.VaadinPlugin.addNewRoute(VaadinPlugin.java:157)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.hotswap.agent.annotation.handler.WatchEventCommand.onWatchEvent(WatchEventCommand.java:190)
at org.hotswap.agent.annotation.handler.WatchEventCommand.executeCommand(WatchEventCommand.java:98)
at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:43)
Caused by: com.vaadin.flow.server.AmbiguousRouteConfigurationException: Navigation targets must have unique routes, found navigation targets 'com.example.test.spring.TestView' and 'com.example.test.spring.TestView' with the same route.
at com.vaadin.flow.server.startup.RouteTarget.validateNormalTarget(RouteTarget.java:163)
at com.vaadin.flow.server.startup.RouteTarget.addTargetByType(RouteTarget.java:107)
at com.vaadin.flow.server.startup.RouteTarget.addRoute(RouteTarget.java:100)
at com.vaadin.flow.router.internal.ConfigureRoutes.setRoute(ConfigureRoutes.java:133)
at com.vaadin.flow.router.internal.AbstractRouteRegistry.addRouteToConfiguration(AbstractRouteRegistry.java:366)
at com.vaadin.flow.router.internal.AbstractRouteRegistry.lambda$setRoute$83b15968$1(AbstractRouteRegistry.java:308)
at com.vaadin.flow.router.internal.AbstractRouteRegistry.configure(AbstractRouteRegistry.java:95)
at com.vaadin.flow.router.internal.AbstractRouteRegistry.setRoute(AbstractRouteRegistry.java:307)
at com.vaadin.flow.server.startup.ApplicationRouteRegistry.setRoute(ApplicationRouteRegistry.java:233)
at com.vaadin.flow.router.RouteConfiguration.setAnnotatedRoute(RouteConfiguration.java:225)
... 13 more
I’m not sure if anyone else is experiencing this?