将 vaadin flow starter 应用程序部署到 WebSphere Liberty 时出错

Error deploying vaadin flow starter application to WebSphere Liberty

我正在尝试将 Vaadin 的入门项目作为 war 部署到 Liberty 服务器,但我遇到了错误。我没有更改项目或服务器设置,因此您可以复制我的问题。
(详情见下方)

Liberty 服务器: WebSphere Liberty Web Profile 8 21.0.0.6

起始项目: https://start.vaadin.com/app?dl&preset=latest

当前版本:

<properties>
        <java.version>8</java.version>
        <vaadin.version>20.0.2</vaadin.version>
</properties>

错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vaadinApplicationContextInitializer' defined in class path resource [com/vaadin/flow/spring/VaadinApplicationConfiguration.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: javax.servlet.ServletException: java.lang.reflect.InvocationTargetException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:610) ~[spring-beans-5.3.6.jar:5.3.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.6.jar:5.3.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean[=11=](AbstractBeanFactory.java:335) ~[spring-beans-5.3.6.jar:5.3.6]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.6.jar:5.3.6]
.
.
.
Unable to find a single class implementing `AppShellConfigurator` from the following candidates:
  com.example.application.Application
  com.vaadin.flow.component.page.AppShellConfigurator

    at com.vaadin.flow.server.AppShellRegistry.setShell(AppShellRegistry.java:140) ~[flow-server-7.0.2.jar:7.0.2]
    at com.vaadin.flow.server.startup.VaadinAppShellInitializer.lambda$init(VaadinAppShellInitializer.java:134) ~[flow-server-7.0.2.jar:7.0.2]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:1.8.0_211]
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) ~[na:1.8.0_211]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_211]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_211]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:1.8.0_211]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:1.8.0_211]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_211]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[na:1.8.0_211]
    at com.vaadin.flow.server.startup.VaadinAppShellInitializer.init(VaadinAppShellInitializer.java:132) ~[flow-server-7.0.2.jar:7.0.2]
    at com.vaadin.flow.server.startup.VaadinAppShellInitializer.initialize(VaadinAppShellInitializer.java:79) ~[flow-server-7.0.2.jar:7.0.2]
    at com.vaadin.flow.server.startup.VaadinServletContextStartupInitializer.process(VaadinServletContextStartupInitializer.java:42) ~[flow-server-7.0.2.jar:7.0.2]
    ... 48 common frames omitted

当我尝试调试时,我注意到 VaadinAppShellInitializer.init 方法“classes”参数包含以下内容:

  1. "界面com.vaadin.flow.component.page.AppShellConfigurator"
  2. "class com.example.application.views.helloworld.HelloWorldView"
  3. "界面com.vaadin.flow.server.PageConfigurator"
  4. "class com.example.application.views.about.AboutView"
  5. "class com.example.application.Application"

正如我所见,两个界面条目导致了问题,但我找不到解决它们的方法。

这是对我有帮助的指南:Deploying a Spring Boot Application with open liberty

  1. 我必须为 liberty 安装 springBoot-2.0 特性
  2. 我必须配置我的 server.xml
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
    <featureManager>
        <feature>servlet-4.0</feature>
        <feature>springBoot-2.0</feature>
    </featureManager>
    <httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443"/>
    <springBootApplication id="guide-spring-boot" location="myapp-1.0-SNAPSHOT.war" name="guide-spring-boot"/>
</server>