“Non HTTP response code” in JMeter means the request failed before a valid HTTP response arrived, so there is no status code to record. JMeter writes the name of the Java exception where the status code would go, and the exception’s message as the response message. The exception class tells you where the request failed: the DNS lookup, the connection, the wait for a reply, or the reply itself.
We reproduced each common one on purpose with a small test server built to fail in specific ways, ran JMeter 5.6.2 against it, and recorded what it wrote. One of the most frequent, NoHttpResponseException, came from a keep-alive timing race in our test: with JMeter’s defaults, 419 of 1,200 requests (34.9%) failed against a server that closes idle connections after 1 second. One property brought that to zero.
Key Takeaways
- The text after “Non HTTP response code:” is a Java exception class. Look it up in the table below to see whether the request failed at DNS, at connect, while waiting, or while reading the reply.
- The elapsed time of a failed sample is a clue: 0 to 1 ms means refused or closed at once, a value equal to a timeout setting means that timeout fired.
NoHttpResponseException: ... failed to respondin the middle of a run is usually a reused keep-alive connection that the server had already closed. Settinghttpclient4.idletimeoutbelow the server’s idle timeout removed every one in our test.httpclient4.retrycount=1also hid the errors for GET requests, but the server received 1,855 requests for 1,200 samples, and POST requests kept failing (412 of 1,200).- JMeter accepts every TLS certificate, so a self-signed certificate for the wrong hostname passed without an error.
What does “Non HTTP response code” mean in JMeter?
It means the HTTP sampler caught a Java exception instead of receiving a complete HTTP response. JMeter’s errorResult method sets the response code to “Non HTTP response code: ” plus the exception’s class name, the response message to “Non HTTP response message: ” plus the exception’s message, and the response data to the stack trace, then marks the sample as failed.
That is why the same label covers very different problems. java.net.UnknownHostException is a DNS failure on the load generator; org.apache.http.NoHttpResponseException means the server closed the connection without answering. Read the class name first, then the message. The stack trace in the sample’s response data (in View Results Tree, or saved in an XML results file) shows which step of the request threw it.
Which Non HTTP response code is which?
Each row below is a failure we produced on purpose against a local test server, with the exception class and message JMeter 5.6.2 recorded, and how long the failed sample took. The HTTP Request sampler had a 1,000 ms connect timeout and a 2,000 ms response timeout. Each case ran twice and the elapsed times are from both runs, except the Socket closed row, which comes from a separate run described below the table.
| Response code (after “Non HTTP response code:“) | Message | What happened | Elapsed |
|---|---|---|---|
org.apache.http.NoHttpResponseException | 127.0.0.1:18081 failed to respond | Server read the request and closed the connection without answering | 0-1 ms |
java.net.SocketException | Connection reset | Server read the request and reset the connection (TCP RST) | 0-1 ms |
java.net.SocketTimeoutException | Read timed out | Server answered after 5 s; the response timeout was 2 s | 2,004-2,006 ms |
org.apache.http.ConnectionClosedException | Premature end of Content-Length delimited message body (expected: 1,000; received: 10) | Server promised 1,000 bytes, sent 10 and closed | 1 ms |
org.apache.http.client.ClientProtocolException | null | Server sent bytes that are not an HTTP response | 1 ms |
org.apache.http.conn.HttpHostConnectException | Connect to 127.0.0.1:18099 [/127.0.0.1] failed: Connection refused (Connection refused) | Nothing listening on the port | 0 ms |
org.apache.http.conn.ConnectTimeoutException | Connect to 192.0.2.1:80 [/192.0.2.1] failed: connect timed out | No answer to the connection attempt; the connect timeout was 1 s | 1,001-1,002 ms |
java.net.UnknownHostException | zz-nohost.invalid: nodename nor servname provided, or not known | DNS lookup failed | 78 ms, then 0 ms |
java.net.SocketException | Socket closed | JMeter itself cut the request off: Stop Test Now, or an Open Model Thread Group schedule that ended mid-request | Up to the moment of the stop |
javax.net.ssl.SSLHandshakeException | Remote host terminated the handshake | HTTPS sent to a plain-HTTP port; the server’s 1 s idle timer closed it | 1,001-1,009 ms |
The Socket closed row came from a separate run (no response timeout set): an Open Model Thread Group whose 3-second schedule ended while 15 requests to the 5-second endpoint were still waiting, so all 15 failed, after 224 to 2,699 ms. The JMeter thread groups guide shows the same message after Stop Test Now and how a pause at the end of the schedule avoids it. Socket closed is the one Non HTTP error that JMeter causes itself.
Two requests passed: the control GET /ok (19 ms, then 1 ms) and, where you might expect a failure, an HTTPS request to a server with a self-signed certificate issued for a different hostname (31 ms, then 1 ms). The certificate case is explained further down.
NoHttpResponseException: “failed to respond”
The server, or something between JMeter and the server, closed the connection after JMeter sent the request and before any response byte came back. The sample fails in about a millisecond. When it appears spread through a run rather than in a burst, the usual cause is a keep-alive connection the server had already closed.
Two different situations produce it:
- The server drops the request. A crash, a restart, or a proxy that closes connections under load all look like this to JMeter. The errors come in a burst and the server or proxy logs show it.
- A stale keep-alive connection. JMeter reuses a connection that sat idle, the server closed it moments earlier, and JMeter’s request lands on a closed socket. The errors are spread through the run, and they get worse with think times close to the server’s idle timeout.
How to fix the keep-alive race
We reproduced the second case: a server that closes idle connections after 1,000 ms and sends no Keep-Alive header, and 20 JMeter threads sending 60 requests each with a 950 to 1,050 ms Uniform Random Timer between them. Then we tried the three HttpClient properties people usually suggest.
| JMeter property | Samples | Errors | Requests the server received |
|---|---|---|---|
| Defaults | 1,200 | 419 (34.9%) | 1,200 |
httpclient4.idletimeout=900 | 1,200 | 0 | 1,200 |
httpclient4.validate_after_inactivity=500 | 1,200 | 6 (0.5%) | 1,200 |
httpclient4.retrycount=1 | 1,200 | 0 | 1,855 |
httpclient4.retrycount=1, POST instead of GET | 1,200 | 412 (34.3%) | 1,200 |
httpclient4.idletimeout is the right fix when the server does not announce its idle timeout. JMeter applies it only when the response carries no Keep-Alive timeout header, and then drops connections that have been idle longer than that, so set it a little below the shortest idle timeout on the path (load balancer, proxy, server). Put it in user.properties or pass it with -J on the command line.
validate_after_inactivity (default 4,900 ms) makes HttpClient check a connection that has been idle longer than the value before reusing it. It cut the errors from 419 to 6, but the check itself can most likely still race with the server’s close, which would explain the remaining 6.
retrycount hides the problem instead of fixing it. With one retry, every GET that hit a closed connection was sent again, so the server received 1,855 requests for 1,200 samples, and the extra load never appears in JMeter’s results. JMeter’s HttpClient retries only idempotent methods by default, so the POST run failed as often as before. httpclient4.request_sent_retry_enabled=true would retry POSTs too, which can submit an order or a payment twice.
java.net.SocketException: Connection reset
The other end sent a TCP reset (RST) instead of closing the connection normally. A server or proxy does this when it gives up on a connection: a worker killed mid-request, an overloaded server rejecting work, a load balancer timing out a backend, or a firewall cutting a flow. In our test the server read the request and reset the connection; JMeter recorded java.net.SocketException with the message Connection reset in 0 to 1 ms.
Look at where the reset came from. If the errors start at a certain thread count, the server or a proxy in front of it is refusing work at that load: check its logs and connection limits. If they appear at a steady rate at any load, a middlebox timeout is more likely.
java.net.SocketTimeoutException: Read timed out
The connection worked and the request was sent, but no response arrived within the sampler’s response timeout. The failed sample’s elapsed time equals that timeout plus a few milliseconds: ours read 2,004 and 2,006 ms against a 2,000 ms setting. If the field is empty, JMeter sets no response timeout on the request, so a stuck server can hold the thread until the connection closes.
Set the timeouts in the HTTP Request sampler, or once in HTTP Request Defaults, under Advanced: “Connect” and “Response” in milliseconds. A response timeout turns a hung server into a counted error and frees the thread. Choose a value above your slowest acceptable response, not your average, or a slow but valid page will count as an error.
Connection refused and connect timed out
Both fail before a request is sent. HttpHostConnectException ... Connection refused means the host answered that nothing is listening on that port, and it fails at once (0 ms in our test). ConnectTimeoutException ... connect timed out means nothing answered at all, so the sample takes the connect timeout plus a millisecond or two (1,001 and 1,002 ms against our 1,000 ms setting).
Refused connections in the middle of a run usually mean the server stopped accepting: it crashed or restarted. At the start of a run they usually mean a wrong host, port or protocol in the test plan. Connect timeouts point at the network: a firewall that drops packets instead of rejecting them, a security group that does not allow the load generator’s address, or an unreachable address. In our test it was a reserved address (192.0.2.1) that no machine answers.
java.net.UnknownHostException
The load generator could not resolve the hostname. Check the spelling in the sampler or HTTP Request Defaults and whether that machine’s DNS can resolve it: a name that works on your laptop may not resolve on a cloud load generator outside your network.
Java caches failed lookups. Our first failed lookup took 78 ms and printed the resolver’s reason; the second took 0 ms and printed only the hostname, because Java served it from its negative cache (10 seconds by default, networkaddress.cache.negative.ttl in the JDK’s java.security file). If a DNS problem lasts only a moment, its errors can therefore last up to 10 seconds longer.
Premature end of message body and ClientProtocolException
These two mean the server answered, but not with a complete, valid HTTP response. ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 1,000; received: 10) appears when the server promised a body length and closed early, often a crash or a proxy timeout mid-response. ClientProtocolException with the message null appeared when the server sent bytes that were not an HTTP response at all.
The first usually comes with errors in the server log at the same moment. The second points at a different service listening on that port, or a broken proxy in between.
SSL errors, and the certificate errors JMeter never shows
An SSL exception means the TLS handshake failed. Sending HTTPS to a plain-HTTP port gave javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake in our test, after the server’s 1-second idle timer closed the connection. Version mismatches and missing client certificates produce other SSL messages.
What JMeter will not report is a bad certificate. Its manual says the HTTP samplers “are configured to accept all certificates, whether trusted or not, regardless of validity periods”. Our server’s self-signed certificate, issued for a different hostname, passed as a 200. A load test therefore cannot tell you that your certificate has expired or does not match the domain. Use a certificate check for that.
Where do the errors show up in the results?
Every Non HTTP response code is a failed sample, so it counts toward the error percentage in the Summary Report, Aggregate Report and the HTML dashboard. The dashboard’s Errors table groups failures by response code and message, so each exception gets its own row with its share of errors and of all samples.
The JMeter HTML report guide walks through that table. Group them by phase when you read them: DNS and connect errors (UnknownHost, refused, connect timeout) say the load never reached the application; read timeouts and resets say it reached the application and the application or a proxy could not keep up; NoHttpResponseException spread evenly through a run says a keep-alive setting. If HTTP 500s appear next to these errors, the 500 errors post covers that half.
When the server logs show nothing at the moments the errors happen, check the load generator itself: its CPU, its memory and jmeter.log. The JMeter heap size guide covers the memory side.
Running the same test plan on LoadFocus
A JMeter test plan with these errors behaves the same in the cloud, but the generators run outside your network, so DNS names and firewall rules that work from your laptop may not.
On LoadFocus JMeter load testing you upload the .jmx, set virtual users, duration and ramp-up for each run and pick the regions, and the results break response times, throughput and errors down by test location, which separates a regional network problem from a server problem.
The LoadFocus documentation explains how its results group errors by type and error rate, including what it looks like when the target filters test traffic: see errors by type and error rate.
Frequently Asked Questions
What does Non HTTP response code mean in JMeter?
It means the request failed before a complete HTTP response arrived, so there was no status code to record. JMeter puts the Java exception’s class name in the response code field and the exception’s message in the response message field. The class name tells you whether DNS, the connection, the wait for a reply or the reply itself failed.
How do I fix NoHttpResponseException in JMeter?
If the errors are spread through the run, JMeter is reusing keep-alive connections that the server has already closed. Set the JMeter property httpclient4.idletimeout a little below the server’s or load balancer’s idle timeout; in our test that took the errors from 419 of 1,200 to zero. If they come in a burst, the server or a proxy dropped requests: check its logs.
Why does JMeter show java.net.SocketException: Connection reset?
The server or something in front of it sent a TCP reset instead of a response. That happens when a server rejects work under load, a worker dies mid-request, or a load balancer or firewall cuts the connection. If the errors start at a certain thread count, look at the server’s connection limits and logs at that load.
What causes Read timed out in JMeter?
The server did not send a response within the sampler’s response timeout. The failed sample’s elapsed time equals that timeout. Either the server was too slow under that load, or the timeout is lower than your slowest acceptable response. Raise it only if the slow responses are acceptable.
Does JMeter check SSL certificates?
No. JMeter’s HTTP samplers accept every certificate, trusted or not, whatever its validity period, so an expired or mismatched certificate passes. Handshake failures such as protocol mismatches still show up as SSL exceptions. Use a separate certificate check for expiry and hostname problems.
Sources
- How the HTTP sampler builds “Non HTTP response code” and “Non HTTP response message”: github.com/apache/jmeter,
HTTPSamplerBase.java(errorResult) at tag rel/v5.6.2, November 2026. - HttpClient settings (
httpclient4.retrycount,request_sent_retry_enabled,idletimeout,validate_after_inactivity,time_to_live) and theStandardHttpRequestRetryHandler: github.com/apache/jmeter,HTTPHC4Impl.javaat tag rel/v5.6.2, and the JMeter properties reference, November 2026. - Certificate handling (“accept all certificates, whether trusted or not”): Apache JMeter, Getting Started, November 2026.
- Negative DNS cache default:
networkaddress.cache.negative.ttl=10in thejava.securityfile of the JDK used for the test (Temurin 11.0.19). - JMeter 5.6.3 change list (no change to the HTTP sampler’s error handling): Apache JMeter changes, November 2026.
- Test runs: JMeter 5.6.2 (HttpClient 4.5.14, Java 11) against a local raw-socket Node.js 23.11.1 test server on 127.0.0.1, Apple M1 Max, macOS 15.7, 23 November 2026. JMeter 5.6.3 is the current release.