I've got a very weird problem...
I am using: Apache Tomcat 5.5, Java 1.5.0, HttpClient (commons-httpclient-3.1.jar).
We have a huge platform that is loaded with the Tomcat Server. But something weird is going on...
Basically when we are trying to send an XML petition via a PostMethod using our platform which creates a
new thread for each job, an connection timeout error occurs, but we are trying to send it by using a simple
thread with a PostMethod, it all works very well.
The two petitions are IDENTICAL - including java code, but it seems that in the case of our platform, the response of the
.executeMethod() is getting very late and with an error.
I wonder which may be the causes for this delay?
More than that, with an older version of our software, everything goes smooth, the code is identical with the one of the
current version, but still there is a difference of how the PostMethod petition is executed. The commons-httpclient.jar
are identical. There are no other jars in the commons of tomcat or in any other classpath folder.
Do I understand correctly that you're saying that single POSTs work OK, but when you flood the Tomcat server with multiple POST threads, it's a problem?
If so, yes it is. Tomcat has a fixed-size thread pool. When more requests come in than there are threads in the pool, the extra requests are going to suffer.
An IDE is no substitute for an Intelligent Developer.
Joined: Jun 09, 2009
The problem was in fact that the application was executing POST-s via a .jar file of some free GIS -type API.
And that POST method was using some native java classes to send the POST-s.
I had to replace the class from the jar, overwriting it with the same class but I had to change the code
that was sending the POST-s with a code that was sending them using the Apache httpclient library.
It seems that the java native way of sending POST-s was working with a delay, but, using the
httpclient it worked perfectly.