我在 JMeter 中遇到了一个非常令人困惑的问题。我正在构建一个 REST Web 服务回归测试计划,并且 GET POST 和 DELETE 运行良好。不幸的是,每当我尝试 PUT 时,我都会收到错误消息
java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
堆栈跟踪:
2013/01/04 13:18:18 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendEntityData(HTTPHC4Impl.java:1023)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:281)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Thread.java:680)
我尝试了很多事情:我在 Content encoding 字段中添加了一个内容类型,尝试在测试计划中注释掉这一行:
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
但这些都不起作用。这是我提出的要求(经过消毒):
URL: ${PATH_TO_SERVICE}/${ID}/category/${CAT_ID}
BODY:
{
"id":"xxxxxxx",
"name":"AUTOREGRESSION",
"icon":"HOME",
"Key" :"99949"
}
HEADERS:
Content-Type : application/json
Accept : application/json
有没有人见过这个?
谢谢。