通过 docker 部署 vertx 应用程序的问题

Problem with deploying vertx app through dockers

我正在关注这个 github project 并且出于某种原因,当我 运行 应用程序时,我收到以下错误:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.NoSuchMethodError: io.vertx.core.http.HttpServer.listen(I)Lio/vertx/core/Future;
    at io.vertx.example.HelloWorldVerticle.start(HelloWorldVerticle.java:10)
    at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:108)
    at io.vertx.core.Verticle.start(Verticle.java:66)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy(DeploymentManager.java:552)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
    at io.vertx.core.impl.EventLoopContext.lambda$executeAsync[=10=](EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
Failed in deploying verticle
java.lang.NoSuchMethodError: io.vertx.core.http.HttpServer.listen(I)Lio/vertx/core/Future;
    at io.vertx.example.HelloWorldVerticle.start(HelloWorldVerticle.java:10)
    at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:108)
    at io.vertx.core.Verticle.start(Verticle.java:66)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy(DeploymentManager.java:552)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
    at io.vertx.core.impl.EventLoopContext.lambda$executeAsync[=10=](EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

java.lang.NoSuchMethodError: io.vertx.core.http.HttpServer.listen(I)Lio/vertx/core/Future;
    at io.vertx.example.HelloWorldVerticle.start(HelloWorldVerticle.java:10)
    at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:108)
    at io.vertx.core.Verticle.start(Verticle.java:66)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeploy(DeploymentManager.java:552)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
    at io.vertx.core.impl.EventLoopContext.lambda$executeAsync[=10=](EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

我在 pom.xml 中看到正在加载 vertx.core,但是当我使用此命令部署到 docker 集线器时: docker run -p 8080:8080 -i -t vertx/vertx3-example 发生错误。有没有人知道如何解决这个问题?

将 Dockerfile 的第一行更新为

FROM vertx/vertx4

来自

FROM vertx/vertx3