I have two different project deployed in tomcat server. From one project I called the web services to call the second project.
Sometime I have to call the web services 200 times at once. So this is what I did:
while(rs.next())
{
Thread t1 = new Thread(new ClassA(a,b);
t1.start();
try {
t1.join();
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
And in this ClassA I called another method from different class which actually call the web service through HTTPClient. The web service takes some time as it perform many functions.
Problem is when I try this many times it give following exception:-
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
Mar 14, 2013 9:04:47 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
Am I doing something wrong here? Should I have to move the code which call the web service inside ClassA class?