【发布时间】:2021-10-03 18:16:59
【问题描述】:
在 WSL 2 中运行时,我所有用 Quarkus/Java 编写的应用程序都无法在 localhost:8000 中访问,以开发模式暴露。
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-07-27 21:13:15,739 INFO [io.quarkus] (Quarkus Main Thread) products 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.3.Final) started in 1.613s. Listening on: http://localhost:8080
2021-07-27 21:13:15,744 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-07-27 21:13:15,745 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [amazon-dynamodb, cdi, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-openapi, swagger-ui]
我更改了端口,但没有任何改变。
我在 WSL 2 中测试运行了一个 docker 镜像,我可以通过 chrome 正常访问。
docker run --publish 8000:8000 amazon/dynamodb-local:1.11.477 -jar DynamoDBLocal.jar -inMemory -sharedDb
我测试了另外一个用vite/vue写的应用,也可以正常访问了。
【问题讨论】:
标签: java google-chrome localhost quarkus wsl-2