I am getting .apache.http.client.ClientProtocolException error on sending ten same requests at a time and around three are getting failed every time (First verified with higher load approximately 3% are getting failed)
e.g. of the request:
POST https://baseURL/portal/test/accessToken
POST data:
{"Name":"abcd","loggedInName":"abcd","passcode":"12345678"}
Cookie Data:
Path=/portal; cookiesession1=12345ASDAS2999832DFGVRQWS123WDCT
Getting below error in the response:
.apache.http.client.ClientProtocolExceptionat .apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187)at .apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)at .apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:935)at .apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:646)at .apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)at .apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)at .apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)at .apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)at .apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)at .apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)at .apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)at java.lang.Thread.run(Unknown Source)Caused by: .apache.http.ProtocolException: The server failed to respond with a valid HTTP responseat .apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:149)at .apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)at .apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)at .apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)at .apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)at .apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)at .apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)at .apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)at .apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)at .apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)at .apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)at .apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)... 11 more
I have added some think time and and verified it by reducing the load. Checked the server log but not getting this error in the log.
I am getting .apache.http.client.ClientProtocolException error on sending ten same requests at a time and around three are getting failed every time (First verified with higher load approximately 3% are getting failed)
e.g. of the request:
POST https://baseURL/portal/test/accessToken
POST data:
{"Name":"abcd","loggedInName":"abcd","passcode":"12345678"}
Cookie Data:
Path=/portal; cookiesession1=12345ASDAS2999832DFGVRQWS123WDCT
Getting below error in the response:
.apache.http.client.ClientProtocolExceptionat .apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187)at .apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)at .apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:935)at .apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:646)at .apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)at .apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)at .apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)at .apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)at .apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)at .apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)at .apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)at java.lang.Thread.run(Unknown Source)Caused by: .apache.http.ProtocolException: The server failed to respond with a valid HTTP responseat .apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:149)at .apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)at .apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)at .apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)at .apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)at .apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)at .apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)at .apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)at .apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)at .apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)at .apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)at .apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)... 11 more
I have added some think time and and verified it by reducing the load. Checked the server log but not getting this error in the log.
Share Improve this question asked Mar 19 at 6:04 TrishaTrisha 12 bronze badges1 Answer
Reset to default 0Your stacktrace is incomplete and it's very hard to read.
You can try getting more information on it by enabling JMeter debug logging for Apache HttpComponents by adding the next line to log4j2.xml file:
<Logger name=".apache.http" level="debug" />
and additionally enable Java network debugging by adding the next line to system.properties file:
javax.debug=all
this way you will have way more information on the failure reason.
Just in case make sure that JMeter machine has sufficient amount of CPU, RAM and network sockets