What are the steps required to run in Production mode?
I have downloaded the starter (pre-release) plain java ‘Click me’ application and it works when run via: mvn jetty:run
But, if I try mvn jetty:run -Pproduction, I get errors:
[qtp218446003-22]
ERROR com.vaadin.flow.server.frontend.FrontendUtils - Cannot get the 'stats.json' from the classpath 'META-INF/VAADIN/config/stats.json'
[qtp218446003-22]
ERROR com.vaadin.flow.server.DefaultErrorHandler -
com.vaadin.flow.server.BootstrapException: Unable to read webpack stats file.
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupFrameworkLibraries(BootstrapHandler.java:837)
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupDocumentHead(BootstrapHandler.java:718)
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.getBootstrapPage(BootstrapHandler.java:521)
If you want to try production mode locally you should use jetty:run-war. So, you should run your app using mvn jetty:run-war -Pproduction. The instruction in the README will be updated. Thanks for reporting this issue
I have one more observation. As suggested, I tried the following command to run in Production mode.
mvn jetty:run-war -Pproduction
It created a war file and running fine. Is this the war file I have to take to a Production machine? If so, I noticed that in the stats.json file, full-path folder names from my Development machine are used (have a look at the "identifier" and "moduleIdentifier" tags).
Hi,
I get the same error. pom.xml is configured as production mode and using wildfly 18.
I did checked this path 'META-INF/VAADIN/config/stats.json' and I see stats.json is not there.
What is the reason for it?
what should I do to solve it?
08:38:21,075 ERROR [com.vaadin.flow.server.frontend.FrontendUtils]
(default task-5) Cannot get the 'stats.json' from the classpath 'META-INF/VAADIN/config/stats.json'
08:38:21,076 ERROR [com.vaadin.flow.server.DefaultErrorHandler]
(default task-5) : com.vaadin.flow.server.BootstrapException: Unable to read webpack stats file.
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupFrameworkLibraries(BootstrapHandler.java:872)
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupDocumentHead(BootstrapHandler.java:749)
at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.getBootstrapPage(BootstrapHandler.java:524)
at com.vaadin.flow.server.communication.WebComponentBootstrapHandler.synchronizedHandleRequest(WebComponentBootstrapHandler.java:195)
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1540)
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:247)
at com.vaadin.cdi.CdiVaadinServlet.service(CdiVaadinServlet.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)