vaadin / archetypes

Archetypes for Vaadin platform
https://vaadin.com
4 stars 7 forks source link

restartedMain thread logs an exception in console in dev-mode #180

Closed manolo closed 3 years ago

manolo commented 3 years ago

Description of the bug / feature

There is an exception message in console when running a flow-spring app in dev-mode.

Note that the execution continues and the app works.

Minimal reproducible example

  mvn -B archetype:generate \
  -DarchetypeGroupId=com.vaadin \
  -DarchetypeArtifactId=vaadin-archetype-spring-application \
  -DarchetypeVersion=21.0.0 \
  -DgroupId=org.example \
  -DartifactId=my-webapp \
  -Dversion=1.0-SNAPSHOT

  cd my-webapp
  mvn

Expected behavior

No disturbing exceptions reported in the console

Actual behavior

2021-09-08 07:42:42.707  INFO 19944 --- [  restartedMain] org.example.Application                  : Started Application in 3.751 seconds (JVM running for 4.115)
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
    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:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoClassDefFoundError: com/vaadin/flow/server/DevModeHandler
    at org.vaadin.artur.helpers.LaunchUtil.isProductionMode(LaunchUtil.java:21)
    at org.vaadin.artur.helpers.LaunchUtil.launchBrowserInDevelopmentMode(LaunchUtil.java:68)
    at org.example.Application.main(Application.java:15)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.server.DevModeHandler
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 8 more

Versions:

- Vaadin / Flow version: 21.0.0
- Java version: 1.8
- OS version: Big Sur
- Browser version (if applicable):
- Application Server (if applicable):
- IDE (if applicable):
Artur- commented 3 years ago

Sounds like an old version of a-vaadin-helpers is used

manolo commented 3 years ago

Then probably it's related to the archetype, we can move the issue there