9

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 ?

4
  • I was getting "Response code: Non HTTP response code: java.net.SocketException" , after searching on the web got the views that by doing the above setting will not get the error , did all the setting but still getting the same error Commented Oct 15, 2015 at 7:39
  • Maybe this can help you stackoverflow.com/questions/30745350/… Check if same problem is with you. Else check if server is running or not or if it overloaded. Commented Oct 15, 2015 at 14:09
  • Thanks for the response, could you please tell how to check the whether the server is overloaded or not ? Commented Oct 16, 2015 at 1:58
  • If its a windows server then check with perfmon utility. if its linux/unix then check with sar, top, vmstat and lot of other are present. First thing I would suggest is check server logs. you will find error logs there. Commented Oct 16, 2015 at 6:55

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

Comments

1

It generally comes when port which you are using for request call (APIs), is not open in the firewall. Check the same API with other applications like Postman or Browser.

sometimes setting JAVA_OPTIONS also solves the problem:

setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

Hit the above command from the command line.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.