7
votes

i am running a load test using Jmeter 2.10 on a web application.

I have a HTTP sampler with View results tree listener and I am running behind corporate proxy.

When i run the thread group even with a single thread,

org.apache.http.NoHttpResponseException: The target server failed to respond
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:95)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:61)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:475)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:295)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

Please Advice

2

2 Answers

13
votes

I faced the same issue "target server failed to respond" and here is what I did:

  1. In your JMETER test plan you must have added 'HTTP Request Defaults". Click on that and for the Implementation field select HttpClient4 option from the dropdown.

  2. Save your test

  3. Now in the apache jmeter's bin folder open the file user.properties and make an entry towards the end of the file as follows:

    • httpclient4.retrycount=1
    • hc.parameters.file=hc.parameters
  4. Now open the file hc.parameters with the same bin folder and make an entry

    • http.connection.stalecheck$Boolean=true
  5. Save these files

  6. Restart jmeter

The above steps helped me resolving the problem.

I got the solution from https://wiki.apache.org/jmeter/JMeterSocketClosed

1
votes

You need to "tell" JMeter to use your corporate proxy via command-line arguments:

As per How do I run JMeter in non-gui mode guide

    -H, --proxyHost <argument>
            Set a proxy server for JMeter to use
    -P, --proxyPort <argument>
            Set proxy server port for JMeter to use
    -N, --nonProxyHosts <argument>
            Set nonproxy host list (e.g. *.apache.org|localhost)
    -u, --username <argument>
            Set username for proxy server that JMeter is to use
    -a, --password <argument>

So something like

jmeter -H 10.10.10.1 -P 3128 

will tell JMeter to use 10.10.10.1:3128 as a proxy. Replace IP and port with the ones from your corporate network.