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


今天使用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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM