Hello Rafael,
Did you ever solve this problem? Could you please share what you did to
solve this? I tried Amila's solution, but did not have any luck. I'm not
sure what I'm missing. I'd appreciate it if you can share your story.
Thanks,
Tariq.
Rafael Barrera Oro wrote:
>
> Thanks for the quick reply! I will definitely give it a try!
>
> As soon as i finish i will report back my results.
>
> Thanks again
>
> Rafael
>
> 2010/1/5 Bruno Simioni
>
>> Rafael, I had exactly the same problem over here. In my case, I used
>> Tomcat
>> servlet container to run Axis2 server (JAX-WS Web Services).
>>
>> In this case, when I tried to shutdown my server, It throw messages
>> accusing instances that cannot be deallocated.
>>
>> I solve that problem with an Amila's blog post,
>> http://amilachinthaka.blogspot.com/2009/05/improving-axis2-client-http-transport.html.
>>
>> Good luck.
>>
>> Bruno Simioni.
>>
>>
>> On Tue, Jan 5, 2010 at 12:31 PM, Rafael Barrera Oro wrote:
>>
>>> Hello!
>>>
>>> I have a sample axis2 client where everything i do is invoking a web
>>> service, the problem is that the third time i invoke such webservice it
>>> always throws a timeout exception. I guess this has to do with some
>>> connection limit or something but after checking axis2.xml i was not
>>> able to
>>> find out how to solve the issue.
>>>
>>> I guess there is a way to tell the axis2 server to keep alive the
>>> connection or close it after its been used. I am no expert here, but it
>>> looks like a connection pooling issue to me.
>>>
>>> Thanks in advance!
>>>
>>> Here is the code:
>>>
>>> public class Axis2Client {
>>>
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> Object[] datosUsuario;
>>> String user = "user";
>>> String pass = "pass";
>>>
>>> try{
>>> //first invocation
>>> datosUsuario = invokeWebService("
>>> http://localhost:8180/axis2/services/LoginService", "login", new
>>> Object[]
>>> {user, pass},new Class[] { Long.class, String.class, String.class,
>>> String.class});
>>>
>>> for(int i = 0; i < datosUsuario.length; i++)
>>> System.out.println(i + " -> " + datosUsuario[i]);
>>>
>>> //second invocation
>>> datosUsuario = invokeWebService("
>>> http://localhost:8180/axis2/services/LoginService", "login", new
>>> Object[]
>>> {user, pass},new Class[] { Long.class, String.class, String.class,
>>> String.class});
>>>
>>> for(int i = 0; i < datosUsuario.length; i++)
>>> System.out.println(i + " -> " + datosUsuario[i]);
>>>
>>> //third invocation
>>> datosUsuario = invokeWebService("
>>> http://localhost:8180/axis2/services/LoginService", "login", new
>>> Object[]
>>> {user, pass},new Class[] { Long.class, String.class, String.class,
>>> String.class});
>>>
>>> for(int i = 0; i < datosUsuario.length; i++)
>>> System.out.println(i + " -> " + datosUsuario[i]);
>>>
>>> }
>>> catch(Exception e){
>>> e.printStackTrace();
>>> }
>>>
>>> }
>>>
>>> public static Object[] invokeWebService(String endPoint, String op,
>>> Object[] opArgs, Class[] returnTypes) throws AxisFault{
>>> RPCServiceClient serviceClient;
>>> Options options;
>>> EndpointReference targetEPR;
>>> QName opQName;
>>> Object[] response = new Object[]{};
>>>
>>> //inicializo el cliente
>>> serviceClient = new RPCServiceClient();
>>> options = serviceClient.getOptions();
>>>
>>> //establezcp el endpoint
>>> targetEPR = new EndpointReference(endPoint);
>>> options.setTo(targetEPR);
>>>
>>> //establezco la operacion
>>> opQName = new QName("
>>> http://services.spring.webservices.dietaclub.akyasociados.com.ar", op);
>>>
>>> //invoco el web service utilizando los parametros y los tipos
>>> que
>>> espero que me sean devueltos
>>> try{
>>> response = serviceClient.invokeBlocking(opQName, opArgs,
>>> returnTypes);
>>> }
>>> catch(AxisFault e){
>>> e.printStackTrace();
>>> throw e;
>>> }
>>> catch(Exception e){
>>> e.printStackTrace();
>>> }
>>>
>>> return response;
>>> }
>>> }
>>>
>>> Here is the exception:
>>>
>>> org.apache.axis2.AxisFault: Timeout waiting for connection
>>> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
>>> at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
>>> at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
>>> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
>>> at
>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
>>> at
>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>>> at
>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
>>> at
>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:540)
>>> at
>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:521)
>>> at
>>> org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
>>> at Axis2Client.invokeWebService(Axis2Client.java:88)
>>> at Axis2Client.main(Axis2Client.java:54)
>>> Caused by: org.apache.commons.httpclient.ConnectionPoolTimeoutException:
>>> Timeout waiting for connection
>>> at
>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
>>> at
>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
>>> at
>>> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
>>> at
>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>>> at
>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
>>> at
>>> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
>>> ... 12 more
>>> org.apache.axis2.AxisFault: Timeout waiting for connection
>>> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
>>> at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
>>> at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
>>> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
>>> at
>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
>>> at
>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>>> at
>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
>>> at
>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:540)
>>> at
>>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:521)
>>> at
>>> org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
>>> at Axis2Client.invokeWebService(Axis2Client.java:88)
>>> at Axis2Client.main(Axis2Client.java:54)
>>> Caused by: org.apache.commons.httpclient.ConnectionPoolTimeoutException:
>>> Timeout waiting for connection
>>> at
>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
>>> at
>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
>>> at
>>> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
>>> at
>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>>> at
>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
>>> at
>>> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
>>> at
>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
>>> ... 12 more
>>>
>>
>>
>
>
--
View this message in context:
http://old.nabble.com/Third-web-service-invoctaion-always-throws-Timeout-Exception-tp27029690p27114735.html
Sent from the Axis - User mailing list archive at Nabble.com.