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