0

Vertx 3.2.1 中的 Spring Boot 部署

我正在尝试部署在 vertx 框架中使用 Spring Boot 开发的服务。

这些服务在 Spring Boot 中开发并使用 Gradle 进行部署。以下是我的开发环境 a) Java 版本 - 1.8 b) Spring boot 版本 - 1.2.8.RELEASE c) Gradle 版本 - 2.0 d) Vertx 版本 - 3.2.1。

使用命令vertx run samplevertx.java -cp sampleFAT.jar启动 vertx 应用程序。当我启动 vertx 应用程序时,抛出以下异常

    WARN  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container.
    nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
    ERROR o.s.boot.SpringApplication - Application startup failed
    org.springframework.context.ApplicationContextException: Unable to start embedded container 
    nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:690)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:970) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:959) 
    at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:111) [vertx-core-3.2.1.jar:na]
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$163(DeploymentManager.java:429) [vertx-core-3.2.1.jar:na]
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335) ~[vertx-core-3.2.1.jar:na]
    at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$265(OrderedExecutorFactory.java:91) ~[vertx-core-3.2.1.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_73]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_73]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_73]
    Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

我尝试了其他成员发布的以下解决方案,但我没有运气。

解决方案 1解决方案 2解决方案 3解决方案 4

我已经在 build.gradle 文件中添加了必要的注释和依赖项,但是问题仍然存在。

论坛里有人可以帮我解决这个问题吗?

4

0 回答 0