【问题标题】:Error deploying vaadin flow starter application to WebSphere Liberty将 vaadin 流启动器应用程序部署到 WebSphere Liberty 时出错
【发布时间】:2021-06-16 14:23:40
【问题描述】:

我正在尝试将 Vaadin 的启动项目作为战争部署到 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$0(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$1(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 方法“类”参数包含以下内容:

  1. “接口 com.vaadin.flow.component.page.AppShellConfigurator”
  2. “com.example.application.views.helloworld.HelloWorldView 类”
  3. “接口 com.vaadin.flow.server.PageConfigurator”
  4. “com.example.application.views.about.AboutView 类”
  5. “类 com.example.application.Application”

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

【问题讨论】:

  • 你的 pom.xml 看起来如何。你说你把包装改成了WAR?
  • @SimonMartinelli 感谢guide,它有帮助。我必须配置 liberty server.xml

标签: spring spring-boot deployment websphere-liberty vaadin-flow


【解决方案1】:

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

  1. 我必须将 springBoot-2.0 功能安装到 liberty
  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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 2019-03-30
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 2017-04-20
    相关资源
    最近更新 更多