Hello Asankha C. Perera.
This is not timeout issue, and I will never know what caused this issue.
Alexy
... note that calling ODE server is quite time consuming, each call
takes from 20 to 40 seconds (maybe more)....
--- 1 - Downloaded Synapse 1.1 release, 3 ODE servers, 4 threads, 5
iterations. From time to time the following exception occur in client:
18:12:09,218 DEBUG HttpMethodDirector.executeWithRetry(403) : Closing
the connection.
18:12:09,218 INFO HttpMethodDirector.executeWithRetry(438) : I/O
exception (org.apache.commons.httpclient.NoHttpResponseException)
caught when processing request: The server localhost failed to respond
18:12:09,234 DEBUG HttpMethodDirector.executeWithRetry(442) : The
server localhost failed to respond
org.apache.commons.httpclient.NoHttpResponseException: The server
localhost failed to respond
This seems like a typical client connection timeout, as you say that a
request takes 20~40 seconds to complete.. To overcome this you should
increase your timeout.. for Synapse we use a default timeout of 60
seconds and easiest way to tune this is by setting a Java system
property "http.socket.timeout" to the desired value in ms. For axis2
clients refer to this <http://wso2.org/library/230>
(http://wso2.org/library/230)
As I can see from logs the scenario is the following: proxy receives
registration request, it sends this request to server and waits, server
processes request for some time (20-40 seconds) and replays
"registration successfull" and at the same time proxy drops connection
with its client (maybe some exception happens in the proxy at this time,
I don't know. Client retries request, and next time proxy succeeds and
doesn't drop connection, but server replays with error, because user
already registered.
--- 2 - Tried to deploy Synapse on Tomcat server, the same default
configuration, I cannot even call one of servers, the first call
returns exception:
Exception in thread "HttpClientWorker-1" java.lang.NullPointerException
....
at
org.apache.synapse.transport.nhttp.HttpCoreNIOSender.sendUsingOutputStream(HttpCoreNIOSender.java:449)
This is a result of the above.. Since Synapse cannot send back the
reply of the closed socket, it tries to get the OutputStream from the
servlet.. which did not send this in the first place anyway..
This is not timeout too. As you can see from logs, the first called
service (principalsService) runs very quickly:
-----------------
2008-04-25 14:46:42,500 [172.29.140.179-ws00-aousov]
[http-8084-Processor25] INFO LogMediator To:
http://localhost:8084/synapse/soap/principalsService, From: 127.0.0.1,
WSAction: urn:addUser, SOAPAction: urn:addUser, Direction: request
...
...
2008-04-25 14:46:43,328 [172.29.140.179-ws00-aousov]
[HttpClientWorker-1] INFO LogMediator To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
, MessageID: urn:uuid:3E27B7248E21F6AFA016069411008043211750373,
Direction: response
-----------------
The call takes less than one second, but anyway some exception happens.
Now, after some investigations I made it work, but the solution is not
one I expected. It works only if I run Synapse standalone, and only if I
run it without native wrapper, i.e. I launch Synapse with following
command line (and no exceptions):
java.exe -Dsynapse.xml=repository\conf\sample\synapse_sample_1001.xml
-Daxis2.xml=repository/conf/axis2.xml -Daxis2.repo=repository
-Djava.endorsed.dirs=lib/endorsed -Dsynapse.home=.
-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration
-Dlog4j.configuration=file:lib/log4j.properties
-Djava.io.tmpdir=work/temp/synapse -Dresolve.root=repository -Xms128m
-Xmx128m -Djava.library.path=lib -classpath "%CLASSPATH%;.........."
org.apache.synapse.SynapseServer repository