发现异常-java.util.zip.ZipException:在jmeter中不是GZIP格式

时间:2019-06-26 10:54:29

标签: exception jmeter gzip

我正在尝试在jmeter中运行记录的脚本,以下是其中一个发布请求的异常。

找到以下异常后,从客户端提供的测试URL成功运行脚本。在此处输入代码

java.util.zip.ZipException:不是GZIP格式

at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.hc.LaxGZIPInputStream.<init>(LaxGZIPInputStream.java:43)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$1.create(HTTPHC4Impl.java:198)
at org.apache.http.client.entity.LazyDecompressingInputStream.initWrapper(LazyDecompressingInputStream.java:51)
at org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:63)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1850)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:477)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:598)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1231)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1220)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at com.blazemeter.jmeter.controller.JMeterThreadParallel.run(JMeterThreadParallel.java:61)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

================================================ ========================== 请帮助我解决问题。

1 个答案:

答案 0 :(得分:1)

  1. 确保添加HTTP Header Manager并将其配置为发送gzip(至少)值为Accept-Encoding的标头
  2. 如果您的HTTP Request采样器请求主体为纯文本,则需要通过JSR223 PreProcessor
  3. 对其进行压缩