Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jmeter Non HTTP response code: java.net.SocketException

Tags:

jmeter

Jmeter response code getting error:

Response code: Non HTTP response code: java.net.SocketException

I have Done the following setting :

  1. user.properties : httpclient4.retrycount=1 and hc.parameters.file=hc.parameters
  2. hc.parameters : http.connection.stalecheck$Boolean=true
  3. Http request sampler unchecked “Use Keep alive” also (as authentication takes more than 10 minutes for 100 users and above and I am not interested that how much time this authentication takes place)

Query : httpclient4.retrycount=1 , value should be set to 1 for n no. of request or no value ?

like image 550
neetu Avatar asked Oct 14 '15 09:10

neetu


People also ask

What causes Java net SocketException?

Closed socket connection - The most common cause of SocketException is reading or writing from or to a closed socket connection. It can also occur when the connection is closed before all the data is read in the socket buffer. Slow network - A poor network connection might also cause a SocketException .

What is Java net SocketException connection reset?

java.net.SocketException: Connection resetThis SocketException occurs on the server-side when the client closed the socket connection before the response could be returned over the socket. For example, by quitting the browser before the response was retrieved. Connection reset simply means that a TCP RST was received.


1 Answers

I am not sure, are you getting this error during load test or even in debugging mode?

  1. If you are debugging then better to use normal thread group with Thread as 1 Ramp-up as 1 Loop as 1

and add Listner > View Result Tree then run script and check response.

  1. If above is passed without giving any errors

Reason for socket exception in Client-Server Application : It consists of two threads. The first one, SimpleServer, opens a socket on the local machine on port 3333. Then it waits for a connection to come in. When it finally receives a connection, it creates an input stream out of it, and simply reads one line of text from the client that was connected. The second thread, SimpleClient, attempts to connect to the server socket that SimpleServer opened. When it does so, it sends a line of text and that’s it. This time though the two threads will be in different classes launched by two different main methods, so as to cause a SocketEception

So, might be you are using lot many threads with very low ramp-up time in script.

If you can provide more details about problem, it will be great.

like image 141
Parvez Avatar answered Oct 17 '22 20:10

Parvez