【发布时间】:2016-07-23 17:12:23
【问题描述】:
我在托管在 IIS 上并使用 ADFS 身份验证机制的 Web 应用程序上运行 Jmeter 脚本。 对于Jmeter中的每个请求,由于“Java.Net.SocketException”而失败。
我所做的是: 使用 HTTP 身份验证管理器从 CSV 数据配置元素为每个用户提供凭据。但 Jmeter 似乎仍然没有登录。
遵循了 Jmeter HTTP 授权管理器的文档,但它似乎没有登录到应用程序
在 Jmeter 日志文件中 - 我看到的是:
org.apache.commons.httpclient.auth.AuthChallengeProcessor: ntlm authentication scheme selected
2014/05/22 16:34:22 INFO - org.apache.commons.httpclient.HttpMethodDirector: No credentials available for NTLM <any realm>@DomainName:PortNumber ..
2014/05/22 16:34:31 INFO - jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 1
2014/05/22 16:34:31 INFO - jmeter.protocol.http.sampler.HTTPHC4Impl: Setting up HTTPS TrustAll scheme
2014/05/22 16:34:32 INFO - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: I/O exception (java.net.SocketException) caught when processing request: Connection reset
2014/05/22 16:34:32 INFO - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: Retrying request
2014/05/22 16:34:32 INFO - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: I/O exception (java.net.SocketException) caught when processing request: Connection reset
2014/05/22 16:34:32 INFO - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: Retrying request
_________________
java.net.SocketException: Connection reset
at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:264)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:520)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)
Caused by: 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.readDataRecord(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
是否会因身份验证失败而发生上述异常?
请建议解决此问题。
提前致谢!!
【问题讨论】:
-
验证在 jmeter 测试中没有使用相同的登录名和密码打开会话,这可能是原因
-
@lmen - 谢谢你的建议..我在 Jmeter 测试中关闭了所有使用登录名和密码打开的会话..并重新启动了 Jmeter 并再次执行了相同的测试,但我得到了同样的错误..
-
不客气,所以请验证您的网络连接,同时验证您正在使用写入端口号访问正确的 url。您是否使用 http(s) 脚本记录器来记录浏览器中的操作?
-
我一定会验证连接、url 和端口详细信息,并让您知道会发生什么,不,我没有使用 HTTP(s) 脚本记录器来记录浏览器中的操作。@lmen - 谢谢-您的快速回复和帮助..