英文:
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 启动后你能看到它使用的端口吗?一旦启动,它会显示类似下面的端口号:
专注分享java语言的经验与见解,让所有开发者获益!
评论