1

Launching beverage-starter-flow with mvn jetty:run then it works just fine. But if download same version of Jetty (9.4.11.v20180605) and launch it through IntelliJ IDEA then I get the following error.

How to fix this? Should skeleton-starter-flow work with standalone Jetty?

here was an exception while trying to navigate to '' with the exception message 'Unable to create an instance of 'com.vaadin.starter.beveragebuddy.ui.views.reviewslist.ReviewsList'. The constructor threw an exception.'
java.lang.IllegalArgumentException: Unable to create an instance of 'com.vaadin.starter.beveragebuddy.ui.views.reviewslist.ReviewsList'. The constructor threw an exception.
    at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:512)
    at com.vaadin.flow.internal.ReflectTools.createInstance(ReflectTools.java:449)
    at com.vaadin.flow.di.DefaultInstantiator.getOrCreate(DefaultInstantiator.java:64)
    at com.vaadin.flow.di.Instantiator.createRouteTarget(Instantiator.java:157)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.lambda$getRouteTarget$1(AbstractNavigationStateRenderer.java:115)
    at java.util.Optional.orElseGet(Optional.java:267)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getRouteTarget(AbstractNavigationStateRenderer.java:114)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.handle(AbstractNavigationStateRenderer.java:166)
    at com.vaadin.flow.router.Router.handleNavigation(Router.java:201)
    at com.vaadin.flow.router.Router.navigate(Router.java:172)
    at com.vaadin.flow.router.Router.initializeUI(Router.java:93)
    at com.vaadin.flow.server.BootstrapHandler.createAndInitUI(BootstrapHandler.java:1050)
    at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:393)
    at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1493)
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:300)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    ...
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45005)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:481)
    ... 51 more
Caused by: java.lang.IllegalStateException: Can't find resource 'frontend://src/views/reviewslist/reviews-list.html' via the servlet context
    at com.vaadin.flow.component.polymertemplate.DefaultTemplateParser.getTemplateContent(DefaultTemplateParser.java:104)
    at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:185)
    at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:93)
    at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:97)
    at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:112)
    at com.vaadin.starter.beveragebuddy.ui.views.reviewslist.ReviewsList.<init>(ReviewsList.java:74)
    ... 55 more
Mika
  • 1,256
  • 13
  • 18
  • How are you launching jetty in IntelliJ? If you go to the Maven panel and run Jetty -> run from within IntelliJ, then it would be the same as running it from the terminal. – Jens Jansson Jul 10 '18 at 12:51
  • @JensJansson I am adding new configuration in Run/Debug Configurations dialog. It is "local" configuration with default configuration. Deployment is beveragebuddy:war. I tried reproducing the problem with my own computer and same setup is working fine. Maybe office laptop failed to download some dependency, but why wouldn't maven build fail to download... – Mika Jul 10 '18 at 16:56

1 Answers1

2

Running Jetty or Tomcat from IntelliJ did not copy frontend folder from webapp sources to target/beveragebuddy-1.0-SNAPSHOT/frontend/. Running mvn package fixed this.

Mika
  • 1,256
  • 13
  • 18