【发布时间】:2021-06-22 08:36:05
【问题描述】:
我发现了适用于 Vaadin 14+ 的非常有前途的 VStepper 插件,但不幸的是我无法让它与 Vaadin 20 一起运行。
当使用 VStepper 添加一些代码时,我总是得到一个 java.lang.IllegalStateException。其他人有同样的问题吗?
Tomcat 8 存在问题。该插件与 Springboot 一起使用。 v-stepper.js 已添加到 node_modules/@vaadin/flow-frontend/ 但 NpmTemplateParser 无法找到它。
堆栈跟踪:
java.lang.IllegalStateException: Couldn't find the definition of the element with tag 'v-stepper' in any template file declared using '@JsModule' annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file
at com.vaadin.flow.component.polymertemplate.NpmTemplateParser.getTemplateContent(NpmTemplateParser.java:155)
at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:217)
at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:100)
at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:94)
at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:109)
at com.mlottmann.vstepper.VStepper.<init>(VStepper.java:53)
【问题讨论】:
-
您能否更具体地说明您如何运行导致(和不导致)此错误的事情?我们可以假设“Tomcat 8”是指您部署了应用程序的独立 Tomcat 吗? “使用springboot”是什么意思-就像在运行fatjar或使用某些构建工具任务时使用嵌入式服务器一样?您正在使用生产版本,对吗?
-
我可以尝试更详细地解释它:“Tomcat 8”是指在我们开发应用程序时使用 IDE 和 maven 构建和非生产模式部署到独立的 tomcat 8 的 Web War 应用程序。 “Springboot”是指在
@SpringBootApplication注解类上使用“debug as java application”启动应用程序的jar包。另请参阅下面@Limespace 的答案,因为这是对问题的进一步调查。
标签: webpack vaadin vaadin-flow