JMeter调用webservice接口报错:java.net.MalformedURLException: Illegal character found in host: ‘/‘--Lph

今天使用Jmeter5.3,调用webservice接口时,一直报错:

Content-Type text/xml
X-Gaia-Api-Key 30adfd-a23-2e026


执行后报错如下:

java.net.MalformedURLException: Illegal character found in host: '/'
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getUrl(HTTPSamplerBase.java:1103)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)

 

问题原因:

host包含特殊符号导致,需要进行处理。

将Server Name和path分开写即可。server name中包含Path路径后,不识别导致。 【用过该方法,可以生效】

 

 


————————————————
版权声明:本文为CSDN博主「xinyuqing」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/xinyuqing/article/details/108625991

posted @ 2021-11-10 16:16  Fecility  阅读(874)  评论(0)    收藏  举报