Rafael, tislam, The solution in Amila's blog uses the solution posted by Deepal. But Amila's blog gives you more control over lots of request, and how to manage memory in that scenario.
Bruno. On Mon, Jan 11, 2010 at 4:10 PM, Rafael Barrera Oro <boraf...@gmail.com>wrote: > Sorry for the radio silence! > > I've been really short of time lately so i am a bit ashamed to say i have > not tried the solution that Bruno proposed yet (the solution in Amila's > blog). Nevertheless i did try what Deepal suggested and it sure did the > trick :D (i was waiting to try both before replying) > > I still want to try the other approach since it seems to me that such > solution provides more control over the web service invocation, however, > being a newbie i'm not very sure which aspect of the web service invocation > i want to control exactly nor how... > > Anyway, i guess it depends on the complexity that we want to achieve > > Thank you all and sorry for taking so long! > > Rafael > > 2010/1/11 tislam <tariq.is...@daston.com> > > 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: Re: Third web service invoctaion always >> throws Timeout >> Exception<http://old.nabble.com/Third-web-service-invoctaion-always-throws-Timeout-Exception-tp27029690p27114735.html> >> Sent from the Axis - User mailing list >> archive<http://old.nabble.com/Axis---User-f232.html>at Nabble.com. >> > >