Wiremock独立jar包–port选项无效。

huangapple 未分类评论46阅读模式
英文:

Wiremock- standalone jar --port option not working

问题

我对WireMock还不熟悉,但我正在尝试使用它来记录一个Java应用程序的请求和响应。我正在使用独立的WireMock JAR文件。以下是我使用的命令:

java -jar /jenkins/tools/wiremock-jre8-standalone-2.26.3.jar --proxy-all=http://server1:33898 --root-dir=src/main/resources/testRecordings/$tagName/recordings/${scenarioName} --port 9523 -verbose

现在,http://server1:33898 是成功的,并且页面成功打开了。但是由于某种原因,http://server1:9523 无法加载页面。我猜这意味着WireMock服务器没有被创建。

我执行了 netstat -tuplen 来检查服务器1上的端口是否处于监听状态。我注意到它正在监听。

tcp6       0      0 :::9523                 :::*                    LISTEN      1000       418954126  39650/java

为什么WireMock服务器没有在端口9523上创建,并且尽管在 java -jar 代码片段中使用了 --port 选项,但 http://server1:9523 无法工作呢?

英文:

I'm new to wiremock, and I'm trying to use it to record the requests & responses of a java application.
I am using standalone wiremock jar for this. Below is the command I am using

java -jar /jenkins/tools/wiremock-jre8-standalone-2.26.3.jar --proxy-all=http://server1:33898 --root-dir=src/main/resources/testRecordings/$tagName/recordings/${scenarioName} --port 9523 -verbose

Now http://server1:33898 is successful and page opens successfully, but for some reason http://server1:9523 does not load the page. I guess it means the wiremock server is not being created.

I did netstat -tuplen to check if the port is in listening status on server1. And I noticed that it was listening.

tcp6       0      0 :::9523                 :::*                    LISTEN      1000       418954126  39650/java 

Why is the wiremock server not getting created on port 9523 and http://server1:9523 not work despite giving --port option in java -jar code snippet above?

答案1

得分: 0

你能加载 http://server1:9523/__admin 吗?
另外,因为你有 --verbose 参数,Wiremock 启动后你能看到它使用的端口吗?一旦启动,它会显示类似下面的端口号:

Wiremock独立jar包–port选项无效。

英文:

Are you able to load http://server1:9523/__admin ?
Also, since you have --verbose, what port do you see once the Wiremock has started? Once it starts, it displays port number like below

Wiremock独立jar包–port选项无效。

huangapple
  • 本文由 发表于 2020年7月26日 13:02:11
  • 转载请务必保留本文链接:https://java.coder-hub.com/63096270.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定