jmeter 4.0 | java.net.socketexception:连接重置

tuwxkamq  于 2021-07-09  发布在  Java
关注(0)|答案(1)|浏览(657)

在录制通过http(s)的测试脚本录制器时,浏览器在导航网站的url时显示以下错误。


**java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:553)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
at org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory.connectSocket(LazySchemeSocketFactory.java:97)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:318)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:235)**

如何解决此问题以录制脚本?

nwwlzxa7

nwwlzxa71#

更新到jmeter最新版本(目前为5)。强烈建议大多数用户运行最新版本。
检查代理连接。如果从代理进行测试,则需要在jmeter中设置代理服务器主机和端口。
为此,运行 jmeter[.bat] 来自命令行的具有以下参数的文件:
-h[代理服务器主机名或ip地址]-p[代理服务器端口]-n[非代理主机](例如.*.apache.org | localhost)-u[代理身份验证用户名-如果需要]-a[代理身份验证密码-如果需要]
例子:

jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost

设置jmeter证书,请按照以下步骤操作https://stackoverflow.com/a/54198897/5938853
有关详细信息,请检查此项:
使用jmeter代理录制
jmeter代理服务器

相关问题