You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by vittal <mv...@gmail.com> on 2013/10/31 22:03:22 UTC

Axis2 : org.apache.axis2.AxisFault: Read timed out

We have web service client generated from wsdl2jave - axis2-1.4.1, we are
getting an error on calling webservice operation
org.apache.axis2.AxisFault: Read timed out more frequently.

please help me providing informaiton

1. I manually set timeout at one of the operation invocation, that looks
fine , but we have call so many places, do i need do same thing every
place.

2. I used below code, just before request to operation, is it correct way
of doing.

int timeOutInMilliSeconds = 3 * 60 * 1000; // Three minutes

stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT,
new Integer(timeOutInMilliSeconds));

stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT,
new Integer(timeOutInMilliSeconds));
        //end here

        GetPermittedTypesResponse response = stub.getPermittedTypes(get);
        permittedTypes = response.getReturn();

3. I see in axis site, Global Configuration (axis2.xml), it will
application to all operatoins, is this file sits on client or server side,
how format looks.

4. can we make service operation as synchronouse, instead of mentioning
timeout, we are not sure how much time operations will take.

4 here is the error stack trace

org.apache.axis2.AxisFault: Read timed out
    at org.apache.axis2.AxisFault.makeFault(Unknown Source)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(Unknown
Source)
    at org.apache.axis2.transport.http.HTTPSender.send(Unknown Source)
    at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(Unknown
Source)
    at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Unknown
Source)
    at org.apache.axis2.engine.AxisEngine.send(Unknown Source)
    at org.apache.axis2.description.OutInAxisOperationClient.send(Unknown
Source)
    at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Unknown
Source)
    at org.apache.axis2.client.OperationClient.execute(Unknown Source)
    at com.ecs.services.EcsObjectServiceStub.instantiateDocument(Unknown
Source)
    at com.ey.edocs.ecs.client.EcsObjectClient.instantiateDocument(Unknown
Source)
    at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsObject(Unknown
Source)
    at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsEmail(Unknown Source)

    at com.ey.edocs.ldi.views.Import$16.run(Unknown Source)
    at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown
Source)
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at org.apache.commons.httpclient.HttpParser.readRawLine(Unknown Source)

    at org.apache.commons.httpclient.HttpParser.readLine(Unknown Source)
    at org.apache.commons.httpclient.HttpConnection.readLine(Unknown
Source)
    at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(Unknown
Source)
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown
Source)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown
Source)
    at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source)

    at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown
Source)
    at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
Source)
    at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
Source)
    at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
Source)
    at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Unknown
Source)
    ... 14 more

---------------------------
Thanks,
Vittal

--

Re: Axis2 : org.apache.axis2.AxisFault: Read timed out

Posted by satyapriya sahoo <sa...@gmail.com>.
Vittal,

Your server is taking too long to response. Presently you are setting 3
minutes in client side. Please increase the time here and test. Where you
are calling the server in client code, you have to set the timeout in
client side (How you did earlier).

Thanks,
Satya


On Sat, Nov 2, 2013 at 10:36 AM, Kishanthan Thangarajah <
kshanth2101@gmail.com> wrote:

>
>
> On Fri, Nov 1, 2013 at 2:33 AM, vittal <mv...@gmail.com> wrote:
> > We have web service client generated from wsdl2jave - axis2-1.4.1, we are
> > getting an error on calling webservice operation
> org.apache.axis2.AxisFault:
> > Read timed out more frequently.
> >
> > please help me providing informaiton
> >
> > 1. I manually set timeout at one of the operation invocation, that looks
> > fine , but we have call so many places, do i need do same thing every
> place.
> >
> > 2. I used below code, just before request to operation, is it correct
> way of
> > doing.
>
> There are two ways you can set timeout values for client side. Either at
> deployment time or run time. The below sets timeout for run-time. For
> deployment time (global level), you can set it using the axis2.xml used at
> client side. This axis2.xml can be used when creating configuration context
> for client side.
>
> For example :
> ConfigurationContext configContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem("location
> of the repository" , "location of axis2.xml");
>
>
> >
> > int timeOutInMilliSeconds = 3 * 60 * 1000; // Three minutes
> >
> >
> stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT,
> > new Integer(timeOutInMilliSeconds));
> >
> >
> stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT,
> > new Integer(timeOutInMilliSeconds));
> >         //end here
> >
> >         GetPermittedTypesResponse response =
> stub.getPermittedTypes(get);
> >         permittedTypes = response.getReturn();
> >
> > 3. I see in axis site, Global Configuration (axis2.xml), it will
> application
> > to all operatoins, is this file sits on client or server side, how format
> > looks.
>
> You have to use the axis2.xml for the client side as mentioned above. For
> server side, there will be a different axis2.xml.
>
> >
> > 4. can we make service operation as synchronouse, instead of mentioning
> > timeout, we are not sure how much time operations will take.
>
>
> If you want your client side to be asynchronous, you can use Axis CallBack
> mechanism. Refer :
> http://www.developer.com/java/web/article.php/3863416/Using-Axis2-and-Java-for-Asynchronous-Web-Service-Invocation-on-the-Client-Side.htm for
> more detail on this.
>
> Or another option is to set "there is no timeout" at client side. For this
> you can set the value as zero.
>
> For me this looks like the server is taking too long to response. Can you
> try increasing the timeout to somewhat larger value and test again?
>
> >
> > 4 here is the error stack trace
> >
> > org.apache.axis2.AxisFault: Read timed out
> >     at org.apache.axis2.AxisFault.makeFault(Unknown Source)
> >     at org.apache.axis2.transport.http.HTTPSender.sendViaPost(Unknown
> > Source)
> >     at org.apache.axis2.transport.http.HTTPSender.send(Unknown Source)
> >     at
> >
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(Unknown
> > Source)
> >     at
> > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Unknown
> > Source)
> >     at org.apache.axis2.engine.AxisEngine.send(Unknown Source)
> >     at org.apache.axis2.description.OutInAxisOperationClient.send(Unknown
> > Source)
> >     at
> > org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Unknown
> > Source)
> >     at org.apache.axis2.client.OperationClient.execute(Unknown Source)
> >     at com.ecs.services.EcsObjectServiceStub.instantiateDocument(Unknown
> > Source)
> >     at
> com.ey.edocs.ecs.client.EcsObjectClient.instantiateDocument(Unknown
> > Source)
> >     at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsObject(Unknown
> Source)
> >     at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsEmail(Unknown
> Source)
> >     at com.ey.edocs.ldi.views.Import$16.run(Unknown Source)
> >     at
> > org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown
> > Source)
> > Caused by: java.net.SocketTimeoutException: Read timed out
> >     at java.io.BufferedInputStream.fill(Unknown Source)
> >     at java.io.BufferedInputStream.read(Unknown Source)
> >     at org.apache.commons.httpclient.HttpParser.readRawLine(Unknown
> Source)
> >     at org.apache.commons.httpclient.HttpParser.readLine(Unknown Source)
>
> >     at org.apache.commons.httpclient.HttpConnection.readLine(Unknown
> Source)
> >     at
> >
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(Unknown
> > Source)
> >     at
> org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown
> > Source)
> >     at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown
> > Source)
> >     at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown
> Source)
> >     at
> > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown
> > Source)
> >     at
> > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
> > Source)
> >     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
> > Source)
> >     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
> > Source)
> >     at
> > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Unknown
> > Source)
> >     ... 14 more
> >
> > ---------------------------
> > Thanks,
> > Vittal
> >
> > --
>

Re: Axis2 : org.apache.axis2.AxisFault: Read timed out

Posted by Kishanthan Thangarajah <ks...@gmail.com>.
On Fri, Nov 1, 2013 at 2:33 AM, vittal <mv...@gmail.com> wrote:
> We have web service client generated from wsdl2jave - axis2-1.4.1, we are
> getting an error on calling webservice operation
org.apache.axis2.AxisFault:
> Read timed out more frequently.
>
> please help me providing informaiton
>
> 1. I manually set timeout at one of the operation invocation, that looks
> fine , but we have call so many places, do i need do same thing every
place.
>
> 2. I used below code, just before request to operation, is it correct way
of
> doing.

There are two ways you can set timeout values for client side. Either at
deployment time or run time. The below sets timeout for run-time. For
deployment time (global level), you can set it using the axis2.xml used at
client side. This axis2.xml can be used when creating configuration context
for client side.

For example :
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem("location
of the repository" , "location of axis2.xml");

>
> int timeOutInMilliSeconds = 3 * 60 * 1000; // Three minutes
>
>
stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT,
> new Integer(timeOutInMilliSeconds));
>
>
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT,
> new Integer(timeOutInMilliSeconds));
>         //end here
>
>         GetPermittedTypesResponse response = stub.getPermittedTypes(get);

>         permittedTypes = response.getReturn();
>
> 3. I see in axis site, Global Configuration (axis2.xml), it will
application
> to all operatoins, is this file sits on client or server side, how format
> looks.

You have to use the axis2.xml for the client side as mentioned above. For
server side, there will be a different axis2.xml.

>
> 4. can we make service operation as synchronouse, instead of mentioning
> timeout, we are not sure how much time operations will take.


If you want your client side to be asynchronous, you can use Axis CallBack
mechanism. Refer :
http://www.developer.com/java/web/article.php/3863416/Using-Axis2-and-Java-for-Asynchronous-Web-Service-Invocation-on-the-Client-Side.htm
for
more detail on this.

Or another option is to set "there is no timeout" at client side. For this
you can set the value as zero.

For me this looks like the server is taking too long to response. Can you
try increasing the timeout to somewhat larger value and test again?
>
> 4 here is the error stack trace
>
> org.apache.axis2.AxisFault: Read timed out
>     at org.apache.axis2.AxisFault.makeFault(Unknown Source)
>     at org.apache.axis2.transport.http.HTTPSender.sendViaPost(Unknown
> Source)
>     at org.apache.axis2.transport.http.HTTPSender.send(Unknown Source)
>     at
>
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(Unknown
> Source)
>     at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Unknown
> Source)
>     at org.apache.axis2.engine.AxisEngine.send(Unknown Source)
>     at org.apache.axis2.description.OutInAxisOperationClient.send(Unknown
> Source)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Unknown
> Source)
>     at org.apache.axis2.client.OperationClient.execute(Unknown Source)
>     at com.ecs.services.EcsObjectServiceStub.instantiateDocument(Unknown
> Source)
>     at com.ey.edocs.ecs.client.EcsObjectClient.instantiateDocument(Unknown
> Source)
>     at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsObject(Unknown
Source)
>     at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsEmail(Unknown
Source)
>     at com.ey.edocs.ldi.views.Import$16.run(Unknown Source)
>     at
> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown
> Source)
> Caused by: java.net.SocketTimeoutException: Read timed out
>     at java.io.BufferedInputStream.fill(Unknown Source)
>     at java.io.BufferedInputStream.read(Unknown Source)
>     at org.apache.commons.httpclient.HttpParser.readRawLine(Unknown
Source)
>     at org.apache.commons.httpclient.HttpParser.readLine(Unknown Source)
>     at org.apache.commons.httpclient.HttpConnection.readLine(Unknown
Source)
>     at
>
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(Unknown
> Source)
>     at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown
> Source)
>     at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown
> Source)
>     at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown
Source)
>     at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown
> Source)
>     at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
> Source)
>     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
> Source)
>     at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown
> Source)
>     at
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Unknown
> Source)
>     ... 14 more
>
> ---------------------------
> Thanks,
> Vittal
>
> --

RE: Axis2 : org.apache.axis2.AxisFault: Read timed out

Posted by Dipesh Garg <di...@erevmax.com>.
Better if you can reuse connection !!

From: vittal [mailto:mvittalreddy@gmail.com]
Sent: Friday, November 01, 2013 2:33 AM
To: java-dev@axis.apache.org
Subject: Axis2 : org.apache.axis2.AxisFault: Read timed out

We have web service client generated from wsdl2jave - axis2-1.4.1, we are getting an error on calling webservice operation org.apache.axis2.AxisFault: Read timed out more frequently.

please help me providing informaiton

1. I manually set timeout at one of the operation invocation, that looks fine , but we have call so many places, do i need do same thing every place.

2. I used below code, just before request to operation, is it correct way of doing.

int timeOutInMilliSeconds = 3 * 60 * 1000; // Three minutes
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, new Integer(timeOutInMilliSeconds));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(timeOutInMilliSeconds));
        //end here

        GetPermittedTypesResponse response = stub.getPermittedTypes(get);
        permittedTypes = response.getReturn();

3. I see in axis site, Global Configuration (axis2.xml), it will application to all operatoins, is this file sits on client or server side, how format looks.

4. can we make service operation as synchronouse, instead of mentioning timeout, we are not sure how much time operations will take.

4 here is the error stack trace

org.apache.axis2.AxisFault: Read timed out
    at org.apache.axis2.AxisFault.makeFault(Unknown Source)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(Unknown Source)
    at org.apache.axis2.transport.http.HTTPSender.send(Unknown Source)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(Unknown Source)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Unknown Source)
    at org.apache.axis2.engine.AxisEngine.send(Unknown Source)
    at org.apache.axis2.description.OutInAxisOperationClient.send(Unknown Source)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Unknown Source)
    at org.apache.axis2.client.OperationClient.execute(Unknown Source)
    at com.ecs.services.EcsObjectServiceStub.instantiateDocument(Unknown Source)
    at com.ey.edocs.ecs.client.EcsObjectClient.instantiateDocument(Unknown Source)
    at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsObject(Unknown Source)
    at com.ey.edocs.ldi.helpers.ObjectHelper.createEcsEmail(Unknown Source)
    at com.ey.edocs.ldi.views.Import$16.run(Unknown Source)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at org.apache.commons.httpclient.HttpParser.readRawLine(Unknown Source)
    at org.apache.commons.httpclient.HttpParser.readLine(Unknown Source)
    at org.apache.commons.httpclient.HttpConnection.readLine(Unknown Source)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(Unknown Source)
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown Source)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown Source)
    at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
    at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
    at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
    at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Unknown Source)
    ... 14 more

---------------------------
Thanks,
Vittal

--