Hello,
I am a complete newbie to Vaadin. I wanted to evaluate and adopt to Vaadin primarily because of the possibililty of developing the entire PWA with Java (server-side components only). I have a gradle multi-project (also on springboot 2) that implements and expose all APIs to front end applications. For that reason, I wanted to start with Vaadin on gradle with springboot as well.
I used base-starter-spring-gradle to jumpstart my evaluation work. with no changes, when i run the project with gradle bootRun
, everything works well and as expected.
I wanted to test running as bootJar (so I can ship this own process/VM). So I follow the instruction on github readme with the command gradle build && java -jar build/libs/base-starter-spring-gradle*.jar
. The gradle build states successful however when springboot starts up, I find the following errors on the console.
Failed to find the following imports in the `node_modules` tree:
- @vaadin/flow-frontend/datepickerConnector.js
- @vaadin/flow-frontend/contextMenuConnector-es6.js
- @vaadin/flow-frontend/comboBoxConnector.js
- @vaadin/flow-frontend/ironListConnector.js
- @vaadin/flow-frontend/timepickerConnector.js
- @vaadin/flow-frontend/comboBoxConnector-es6.js
- @vaadin/flow-frontend/ironListStyles.js
- @vaadin/flow-frontend/selectConnector.js
- @vaadin/flow-frontend/vaadin-big-decimal-field.js
- @vaadin/flow-frontend/contextMenuConnector.js
- @vaadin/flow-frontend/gridConnector.js
- @vaadin/flow-frontend/flow-component-renderer.js
- @vaadin/flow-frontend/gridConnector-es6.js
- @vaadin/flow-frontend/dndConnector-es6.js
- @vaadin/flow-frontend/ironListConnector-es6.js
- @vaadin/flow-frontend/menubarConnector.js
- @vaadin/flow-frontend/vaadin-grid-flow-selection-column.js
- @vaadin/flow-frontend/dndConnector.js
If the build fails, check that npm packages are installed.
And then repeated print @ ../target/frontend/generated-flow-imports.js
for each component listed above. But the server starts and the browser display appears broken (as if no css is connected) and an overlay box is displayed with message…
Webpack Error
Webpack build failed with errors:
ERROR in ../target/frontend/generated-flow-imports.js
I notice a hint to enable production mode for standalone bootjar and so I add -PproductionMode
to the build and execute I used above. This time the buildFrontend
fails with message Unable to locate a required class using custom class loader
. Enabling stacktace in gradle, I find the root cause to be the following…
Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.component.WebComponentExporterFactory
at com.vaadin.flow.server.scanner.ReflectionsClassFinder.loadClass(ReflectionsClassFinder.java:85)
at com.vaadin.flow.server.frontend.scanner.ClassFinder$CachedClassFinder.loadClass(ClassFinder.java:141)
at com.vaadin.flow.server.frontend.scanner.ClassFinder.getSubTypesOf(ClassFinder.java:217)
at com.vaadin.flow.server.frontend.FrontendWebComponentGenerator.generateWebComponents(FrontendWebComponentGenerator.java:82)
... 100 more
Note: I did pore over google and vaadin forum for this situation. I did find a couple issues discussed about the missing webpack modules but they were all about maven plugin issues and I do not have such problems in my gradle build script. The starter project does not use RC or snapshot artefacts. Also, there is no error regarding the vaadin plugin applied to the project.
Many thanks in advance for any help resolving the issue. Would encourage me in continuing with Vaadin.
Thanks and best regards,
Sathya