My application has a number of HTTP web services. While writing a regression test I am getting "java.net.ConnectException: Connection refused: connect" exception.
Though I have verified that the service never goes down even when these errors come. The test class is attached for reference.
Please suggest what is not working out here.
The first array element uses port 2001, the others use 7001. Maybe that's the problem?
Also, your time measurement only measures how long it takes to submit all these requests. The requests themselves are executed in different threads. Store the results of the calls to es.submit() into a List<Future<?>>, then after the submitting of all requests loop over this List and call get() on each element.
Thanks Rob. The port probably got incorrect while changing the URL's to dummy
Thanks for the time evaluation tip.
Though the real problem that's happening is that, when i run the program a large number of requests fail with the java.net.ConnectException: Connection refused: connect
I included the url in the error, but couldn't see a pattern, as the url calls are randomized, so randomly they fail.
Though i found this link, and when i ran with requests less than 3900, the program worked
correctly for most times in windows.