当使用Jmeter运行负载测试时,得到以下结果,但是当检查服务器日志时,没有任何异常,并且它已经成功地将响应返回到Jmeter。这里可能是什么问题?
<responseData
class="java.lang.String">org.apache.http.MalformedChunkCodingException: Bad chunk
header:
{"...<<My Response>>;
,"desc":"Success"}}
at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:274)
at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:222)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:183)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1944)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:476)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:677)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1301)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
at java.lang.Thread.run(Thread.java:750)
</responseData>
1条答案
按热度按时间qeeaahzv1#
您可以通过在 * log4j2.xml * 文件(位于JMeter安装的"bin"文件夹中)中添加下一行来执行enable tracing requests and responses
这样,当您发送和接收jmeter.log文件中的请求时,您将看到网络级别上发生的情况
最有可能的是,JMeter期望一个分块响应,而不是得到类似关闭连接或connection reset的响应。
查看Bad chunk header mystery文章以了解调查示例