使用Jmeter发送HTTP消息时出错:软件导致连接中止:recv失败

时间:2015-04-14 08:27:07

标签: jmeter

我正在使用Jmeter在apache服务器上发布消息。我正在使用ssl(提供.pfx格式的证书)来发送消息,但收到以下错误:

  

java.net.SocketException:软件导致连接中止:recv   在java.net.SocketInputStream.socketRead0(本机方法)处失败   java.net.SocketInputStream.read(未知来源)at   java.net.SocketInputStream.read(未知来源)at   sun.security.ssl.InputRecord.readFully(未知来源)at   sun.security.ssl.InputRecord.read(未知来源)at   sun.security.ssl.SSLSocketImpl.readRecord(未知来源)at   sun.security.ssl.SSLSocketImpl.waitForClose(未知来源)at   sun.security.ssl.HandshakeOutStream.flush(未知来源)at   sun.security.ssl.Handshaker.sendChangeCipherSpec(未知来源)at   sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(未知   来源)sun.security.ssl.ClientHandshaker.serverHelloDone(未知   来源)sun.security.ssl.ClientHandshaker.processMessage(未知   来源)sun.security.ssl.Handshaker.processLoop(未知来源)     在sun.security.ssl.Handshaker.process_record(未知来源)at   sun.security.ssl.SSLSocketImpl.readRecord(未知来源)at   sun.security.ssl.SSLSocketImpl.performInitialHandshake(未知来源)     在sun.security.ssl.SSLSocketImpl.writeRecord(未知来源)at   sun.security.ssl.AppOutputStream.write(未知来源)at   java.io.BufferedOutputStream.flushBuffer(未知来源)at   java.io.BufferedOutputStream.write(未知来源)at   java.io.FilterOutputStream.write(未知来源)at   org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(StringRequestEntity.java:145)     在   org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)     在   org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)     在   org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)     在   org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)     在   org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)     在   org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)     在   org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)     在   org.apache.jmeter.protocol.http.sampler.HTTPHC3Impl.sample(HTTPHC3Impl.java:265)     在   org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)     在   org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)     在   org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)     在   org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)     在org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)     在java.lang.Thread.run(未知来源)

2 个答案:

答案 0 :(得分:1)

可以通过对所有HTTP请求专门使用Java实现来修复错误。

使用HTTPClient3.1实现时会发生很多错误,使用HTTPClient4实现时很少发生此错误。

确保所有HTTP请求和HTTP请求默认值都使用Java实现。

答案 1 :(得分:0)

您需要添加HTTP Cookie管理器。