tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bert Verhees <bert.verh...@rosa.nl>
Subject Unable to sendViaPost to url...... .... java.net.SocketTimeoutException: Read timed out
Date Mon, 16 Jan 2012 16:15:14 GMT
Hi, I hope you can help me analyzing this problem:

I am using Tomcat6 6.0.32-5ubuntu1.1 together with Axis2 1.6.1

I am not sure if it is an Axis2 problem or a Tomcat-problem.

I have an client-application for test-purposes which runs inside the 
Eclipse-IDE.
The problem only occurs when running Axis2 inside Tomcat6, when running 
in Axis2 as stand-alone server, it runs better.

What I do is posting arrays of strings (about 50 elements, about 5Kb 
max) to an webservice-call.
After some validation, the webservice posts the data to a postgresql 
database.

I have some console-output to see how long it takes.

storing.....  Person:26, ID:27
Creating EHR for:213d7c09-949c-4757-a91d-da5510215472
GUIDs saved to table:213d7c09-949c-4757-a91d-da5510215472, 
73b60dd4-d745-4267-9c6f-fc8b067bfeb9
stored.....  Person:26, UID:213d7c09-949c-4757-a91d-da5510215472
PT0.647S

As you can see, it starts with less then a second, sometime 0.3 seconds, 
sometimes 1.1 second, depending on the number of elements in the array 
to store.

After 1000 persons stored, it takes 4 seconds

storing.....  Person:998, ID:989
Creating EHR for:49c96d87-38db-491d-a824-78800615e80a
GUIDs saved to table:49c96d87-38db-491d-a824-78800615e80a, 
3554514f-ccb6-40dd-92f2-d9140760870e
stored.....  Person:998, UID:49c96d87-38db-491d-a824-78800615e80a
PT4.147S

When running in Axis2 standalone, it stays about 4 seconds until 8000 
persons stored (which is the complete group to store)
This is slow, I must investigate the library directly without webservice 
if that is a problem of my coding. So we forget that for the moment.

The problem which bothers me is when I am using Tomcat.

The problem start to occur after posting 1200 patients, it takes 8 
seconds. When it reaches 1300, it already takes 17 seconds.
When at Person 1330, it is already 29 seconds, and at 1340 it is 39 
seconds, and than a few persons more and a time-out exception occurs.

I receive a java.net.SocketTimeoutException: Read timed out from the 
client side-code. The default time-out time for Axis2-code is 40 seconds.
The printstacktrace is below, but it is client side stacktrace

I try a lot of things to solve the problem. I put a Thread.sleep(1000); 
in my client-code between to postings, I thought, maybe the webservice 
needs some rest to do garbage-clean up. Because it looks very much like 
a memory blowing up. But it didn't help.

Of course, if you need any information, I will be happy to provide it, 
please give some hints how to provide it

---
Kind regards and much thanks
Bert Verhees

---

I don't know if it is of any help, but I put the exception-trace below

14.01.2012 13:33:52  INFO (HTTPSender.java:196) - Unable to sendViaPost 
to url[http://localhost:8080/axis2/services/DemographicService/]
java.net.SocketTimeoutException: Read timed out
     at java.net.SocketInputStream.socketRead0(Native Method)
     at java.net.SocketInputStream.read(SocketInputStream.java:146)
     at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
     at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
     at 
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
     at 
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
     at 
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
     at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
     at 
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
     at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
     at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     at 
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
     at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
     at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
     at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
     at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
     at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
     at 
openehr.rosa.demographicservice.DemographicServiceStub.saveDemographicNew(DemographicServiceStub.java:2668)
     at nl.rosa.persons.StorePersons.storePerson(StorePersons.java:77)
     at nl.rosa.persons.StorePersons.storePersons(StorePersons.java:49)
     at run.FillDatabase.main(FillDatabase.java:35)
org.apache.axis2.AxisFault: Read timed out
     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
     at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
     at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
     at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
     at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
     at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
     at 
openehr.rosa.demographicservice.DemographicServiceStub.saveDemographicNew(DemographicServiceStub.java:2668)
     at nl.rosa.persons.StorePersons.storePerson(StorePersons.java:77)
     at nl.rosa.persons.StorePersons.storePersons(StorePersons.java:49)
     at run.FillDatabase.main(FillDatabase.java:35)
Caused by: java.net.SocketTimeoutException: Read timed out
     at java.net.SocketInputStream.socketRead0(Native Method)
     at java.net.SocketInputStream.read(SocketInputStream.java:146)
     at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
     at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
     at 
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
     at 
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
     at 
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
     at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
     at 
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
     at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
     at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     at 
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
     at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
     ... 11 more
Exception in thread "main" org.apache.axis2.AxisFault: Read timed out
     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
     at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
     at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
     at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
     at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
     at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
     at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
     at 
openehr.rosa.demographicservice.DemographicServiceStub.saveDemographicNew(DemographicServiceStub.java:2668)
     at nl.rosa.persons.StorePersons.storePerson(StorePersons.java:77)
     at nl.rosa.persons.StorePersons.storePersons(StorePersons.java:49)
     at run.FillDatabase.main(FillDatabase.java:35)
Caused by: java.net.SocketTimeoutException: Read timed out
     at java.net.SocketInputStream.socketRead0(Native Method)
     at java.net.SocketInputStream.read(SocketInputStream.java:146)
     at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
     at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
     at 
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
     at 
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
     at 
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
     at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
     at 
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
     at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
     at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
     at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     at 
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
     at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
     ... 11 more






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message