This project is a clone of the Vaadin 14 addon starter project downloaded from https://vaadin.com/start/latest. The only changes made are the following:
- Moved the View class from test to the main project for testing reasons.
- Added VaadinAppServlet extending the VaadinServlet to map the application to context "/app"
- Updated the jetty-maven-plugin version
Starting the app:
- Run
mvn -U clean jetty:run
. - Open http://localhost:8080/app in the browser.
With jetty-maven-plugin version 9.4.18.v20190429 and lower, everything works as expected. The application starts and can be opened from the browser. With jetty-maven-plugin version 9.4.19.v20190610 and newer, the vaadin application cannot be started. Jetty still starts but throws the following exception:
Failed startup of context o.e.j.m.p.JettyWebAppContext@3dad8bde{/,file:///D:/vaadinjetty/target/webapp-tmp/,UNAVAILABLE}{file:///D:/vaadinjetty/target/webapp-tmp/}
java.lang.NoClassDefFoundError: com/vaadin/flow/server/VaadinServlet
at java.lang.ClassLoader.defineClass1 (Native Method)
at java.lang.ClassLoader.defineClass (ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass (URLClassLoader.java:468)
at java.net.URLClassLoader.access$100 (URLClassLoader.java:74)
at java.net.URLClassLoader$1.run (URLClassLoader.java:369)
at java.net.URLClassLoader$1.run (URLClassLoader.java:363)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (URLClassLoader.java:362)
at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass (WebAppClassLoader.java:670)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource (WebAppClassLoader.java:639)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (WebAppClassLoader.java:545)
at java.lang.ClassLoader.loadClass (ClassLoader.java:351)
at org.eclipse.jetty.util.Loader.loadClass (Loader.java:65)
at org.eclipse.jetty.webapp.DiscoveredAnnotation.loadClass (DiscoveredAnnotation.java:82)
at org.eclipse.jetty.webapp.DiscoveredAnnotation.getTargetClass (DiscoveredAnnotation.java:67)
at org.eclipse.jetty.annotations.WebServletAnnotation.apply (WebServletAnnotation.java:72)
at org.eclipse.jetty.webapp.MetaData.resolve (MetaData.java:425)
at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1457)
at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:854)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:278)
at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:545)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:428)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.server.Server.start (Server.java:418)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart (Server.java:382)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:477)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:343)
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:171)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.server.VaadinServlet
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (WebAppClassLoader.java:555)
at java.lang.ClassLoader.loadClass (ClassLoader.java:351)
at java.lang.ClassLoader.defineClass1 (Native Method)
at java.lang.ClassLoader.defineClass (ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass (URLClassLoader.java:468)
at java.net.URLClassLoader.access$100 (URLClassLoader.java:74)
at java.net.URLClassLoader$1.run (URLClassLoader.java:369)
at java.net.URLClassLoader$1.run (URLClassLoader.java:363)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (URLClassLoader.java:362)
at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass (WebAppClassLoader.java:670)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource (WebAppClassLoader.java:639)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (WebAppClassLoader.java:545)
at java.lang.ClassLoader.loadClass (ClassLoader.java:351)
at org.eclipse.jetty.util.Loader.loadClass (Loader.java:65)
at org.eclipse.jetty.webapp.DiscoveredAnnotation.loadClass (DiscoveredAnnotation.java:82)
at org.eclipse.jetty.webapp.DiscoveredAnnotation.getTargetClass (DiscoveredAnnotation.java:67)
at org.eclipse.jetty.annotations.WebServletAnnotation.apply (WebServletAnnotation.java:72)
at org.eclipse.jetty.webapp.MetaData.resolve (MetaData.java:425)
at org.eclipse.jetty.webapp.WebAppContext.startContext (WebAppContext.java:1457)
at org.eclipse.jetty.server.handler.ContextHandler.doStart (ContextHandler.java:854)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart (ServletContextHandler.java:278)
at org.eclipse.jetty.webapp.WebAppContext.doStart (WebAppContext.java:545)
at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart (JettyWebAppContext.java:428)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start (ContainerLifeCycle.java:167)
at org.eclipse.jetty.server.Server.start (Server.java:418)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart (ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart (AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart (Server.java:382)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:68)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty (AbstractJettyMojo.java:477)
at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute (AbstractJettyMojo.java:343)
at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute (JettyRunMojo.java:171)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Resulting in a error 503 when opened in the browser.