Open petrixh opened 5 years ago
The issue seems to still reproduce with V23.4 and Spring Boot 2.7. If running the app with spring-boot:run the following workaround seems to help:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dcom.vaadin.mpr.productionMode=true" -Pproduction
While working on a MPR migration project, we noticed that the application.properties values are not picked up by the MPRServlet.. Most notably, trying to set the application to production mode left the V8 runtime still in debug mode.
After some investigation a possible cause was found:
AbstractMprServlet#createDeploymentConfiguration(Properties initParameters)
looks for:
But in a spring-boot environment, the servlet is under a different key or loaded at a different time.
A bit of pre-debugging indicates that at the point where the MPR deployment configs are read, none of the entries in the ServletContext is an instance of com.vaadin.flow.server.VaadinServlet
Workaround for production mode (but not all application.properties settings) is to set the following System property:
com.vaadin.mpr.productionMode=true
So for instance:
java -jar -Dcom.vaadin.mpr.productionMode=true xxxx.war
Observed with: Vaadin 14.0.2 MPR 2.0.0