【问题标题】:Quarkus not serving swagger on local machineQuarkus 不在本地机器上大张旗鼓地服务
【发布时间】:2021-01-20 20:39:09
【问题描述】:

我正在尝试从我的本地机器(Windows)运行 Quarkus。有用。但是,当我转到着陆页时,它不会招摇。

日志显示:

21:29:04 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
21:29:04 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cdi, hibernate-orm, hibernate-validator, micrometer, mutiny, narayana-jta, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, smallrye-openapi, swagger-ui, vertx, vertx-web]
21:29:30 INFO  [io.qua.htt.access-log] (vert.x-eventloop-thread-10) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui HTTP/1.1" 302 -
21:29:30 INFO  [io.qua.htt.access-log] (executor-thread-3) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui/style.css HTTP/1.1" 404 -
21:29:30 INFO  [io.qua.htt.access-log] (executor-thread-4) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui/theme-feeling-blue.css HTTP/1.1" 404 -
21:29:30 INFO  [io.qua.htt.access-log] (executor-thread-5) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui-bundle.js HTTP/1.1" 404 -
21:29:30 INFO  [io.qua.htt.access-log] (executor-thread-2) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui.css HTTP/1.1" 404 -
21:29:30 INFO  [io.qua.htt.access-log] (executor-thread-1) 127.0.0.1 - - 20/Jan/2021:21:29:30 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js HTTP/1.1" 404 -

可能有一些明显的东西。它显示了 openapi 的下载对话框以及我定义的其他调用,它们都可以正常工作。

完全相同的 maven 项目在我同事的机器上运行,它在 docker 上部署/运行。我已经寻找了几天,但我没有看到解决方案。我查看了 hosts 文件。

我该如何调试呢?关于可能出错的任何提示?我是 Quarkus 的新手(正忙着找路)

完整日志:

2:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) requestBegin /gm/gmw-v1.1/swagger-ui: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2041381}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@2cc5a745
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@2cc5a745, io.vertx.core.http.impl.HttpServerResponseImpl@41ed01b5
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) requestBegin /gm/gmw-v1.1/swagger-ui/swagger-ui.css: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2041381}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5e89e630
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-4) requestBegin /gm/gmw-v1.1/swagger-ui/theme-feeling-blue.css: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@4c7b1d36}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@40364d3a
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-0) requestBegin /gm/gmw-v1.1/swagger-ui/style.css: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2582ead0}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5b247e88
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-14) requestBegin /gm/gmw-v1.1/swagger-ui/swagger-ui-bundle.js: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2a0e7a80}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@686abd43
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-1) requestBegin /gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@718a2eb0}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5a754f7f
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-1) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/style.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-1) RESTEASY002315: PathInfo: /swagger-ui/style.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-1) {text/css=org.jboss.resteasy.core.request.QualityValue@3e8, */*=org.jboss.resteasy.core.request.QualityValue@64}
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-1) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5b247e88, io.vertx.core.http.impl.HttpServerResponseImpl@37a17692
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-1) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/style.css HTTP/1.1" 404 -
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-6) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/theme-feeling-blue.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-6) RESTEASY002315: PathInfo: /swagger-ui/theme-feeling-blue.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-6) {text/css=org.jboss.resteasy.core.request.QualityValue@3e8, */*=org.jboss.resteasy.core.request.QualityValue@64}
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-1) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-6) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@40364d3a, io.vertx.core.http.impl.HttpServerResponseImpl@4ba14ca1
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-1) RESTEASY002315: PathInfo: /swagger-ui/swagger-ui-standalone-preset.js
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-6) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/theme-feeling-blue.css HTTP/1.1" 404 -
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-1) {*/*=org.jboss.resteasy.core.request.QualityValue@3e8}
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-6) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/swagger-ui.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-6) RESTEASY002315: PathInfo: /swagger-ui/swagger-ui.css
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-6) {text/css=org.jboss.resteasy.core.request.QualityValue@3e8, */*=org.jboss.resteasy.core.request.QualityValue@64}
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-1) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5a754f7f, io.vertx.core.http.impl.HttpServerResponseImpl@9eb2123
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-6) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@5e89e630, io.vertx.core.http.impl.HttpServerResponseImpl@911f62c
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-6) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui.css HTTP/1.1" 404 -
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-1) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js HTTP/1.1" 404 -
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-7) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/swagger-ui-bundle.js
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) RESTEASY002315: PathInfo: /swagger-ui/swagger-ui-bundle.js
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) {*/*=org.jboss.resteasy.core.request.QualityValue@3e8}
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-7) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@686abd43, io.vertx.core.http.impl.HttpServerResponseImpl@7ba23767
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-7) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui-bundle.js HTTP/1.1" 404 -
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) requestBegin /gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2041381}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@35450f9e
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (executor-thread-7) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) RESTEASY002315: PathInfo: /swagger-ui/swagger-ui-standalone-preset.js
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) {*/*=org.jboss.resteasy.core.request.QualityValue@3e8}
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-7) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@35450f9e, io.vertx.core.http.impl.HttpServerResponseImpl@21e48dcf
22:59:36 INFO  [io.qua.htt.access-log] (executor-thread-7) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/swagger-ui-standalone-preset.js HTTP/1.1" 404 -
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) requestBegin /gm/gmw-v1.1/swagger-ui/favicon.ico: {CONNECTED_SOCKET_SAMPLE=io.micrometer.core.instrument.composite.CompositeLongTaskTimer$CompositeSample@2041381}, io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@7d2b0755
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (vert.x-eventloop-thread-13) requestReset: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@7d2b0755
22:59:36 DEBUG [io.qua.ver.htt.run.ForwardedParser] (vert.x-eventloop-thread-13) Recalculated absoluteURI to http://localhost:8080/gm/gmw-v1.1/swagger-ui/favicon.ico
22:59:36 INFO  [io.qua.htt.access-log] (vert.x-eventloop-thread-13) 127.0.0.1 - - 20/Jan/2021:22:59:36 +0100 "GET /gm/gmw-v1.1/swagger-ui/favicon.ico HTTP/1.1" 200 -
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) RESTEASY002315: PathInfo: /swagger-ui/favicon.ico
22:59:36 DEBUG [org.jbo.res.res.i18n] (executor-thread-7) {image/webp=org.jboss.resteasy.core.request.QualityValue@3e8, */*=org.jboss.resteasy.core.request.QualityValue@3e8}
22:59:36 DEBUG [io.qua.mic.run.bin.ver.VertxHttpServerMetrics] (executor-thread-7) responseEnd: io.quarkus.micrometer.runtime.binder.vertx.RequestMetric@7d2b0755, io.vertx.core.http.impl.HttpServerResponseImpl@5009f63c

【问题讨论】:

  • 嗨,我没有回答,但只是一些想法 - 想知道是否可以提高日志级别以调试更多线索?另外,我注意到对主要 get 的 302 响应 - 您可以查看开发人员工具以查看重定向的位置
  • 记录 get 的事实意味着服务器正在接收您的请求,因此排除了 docker 问题,例如侦听 VM IP 地址而不是 localhost。我猜开发人员工具可能是最好的下一步 - 您可以在日志中看到服务器端,以便查看客户端发生了什么
  • @Chris 谢谢。 “开发人员工具”是什么意思。我错过了文档中的某些内容吗?我会尝试提高日志级别。我有点愚蠢,我没有想到这一点。
  • 对不起,我的意思是如果你在浏览器中点击这个然后开发工具在那里 - 我猜你使用的是浏览器而不是邮递员或 curl 或类似的,但我不太了解quarkus 知道您将如何访问 swagger 文档
  • 啊..我明白了..

标签: java swagger-ui quarkus


【解决方案1】:

我找到了解决方案。 Quarkus 似乎将其网络资源存储在 /tmp 文件夹中(请参阅:https://github.com/quarkusio/quarkus/issues/12577)。我去了 git-bash 中的 /tmp 文件夹,然后删除了所有文件/文件夹(操作系统允许我删除)。

瞧,在那之后它开始工作了。

【讨论】:

    【解决方案2】:

    我没有足够的声誉来添加评论,但只是想为这个主题做出贡献:在macOS上,临时目录不是/tmp,它是在环境变量$TMPDIR上定义的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-18
      • 2010-09-13
      • 1970-01-01
      • 2010-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多