I am using Axis 1.4.1.
Initially I thought the issue is with axiom, so I upgraded the axiom impl to
1.2.8, but the issue is not solved.
Please find the code below.
try {
String tns = "http://schemas.sample.com/1.0";
QName srvcQName = new QName(tns, "HelloWorldService");
QName portQName = new QName(tns,
"HelloWorldServiceEndpoint");
Service svc = Service.create(srvcQName);
svc.addPort(portQName, SOAPBinding.SOAP12HTTP_BINDING,
"http://localhost:8080/hw/services/HelloWorldService");
Dispatch<Source> dispatch = svc.createDispatch(portQName,
Source.class, Service.Mode.PAYLOAD);
dispatch.getRequestContext().put(HTTPConstants.HTTP_PROTOCOL_VERSION,
"HTTP/1.0");
StringReader reader = new
StringReader("<HelloWorldRequest><Name>Hi
there</Name></HelloWorldRequest>");
Source request = new StreamSource(reader);
MultiThreadedHttpConnectionManager connMgr = new
MultiThreadedHttpConnectionManager();
HttpClient client = new HttpClient(connMgr);
dispatch.getRequestContext().put(HTTPConstants.REUSE_HTTP_CLIENT,
"true");
dispatch.getRequestContext().put(HTTPConstants.CACHED_HTTP_CLIENT,
client);
Source response;
try {
response = dispatch.invoke(request);
} finally {
connMgr.closeIdleConnections(0);
connMgr.shutdown();
}
} catch (Exception e) {
e.printStackTrace();
}
Regards
Jiji
--
View this message in context:
http://www.nabble.com/Axis2-memory-leak-with-backport-util-tp23874797p23876010.html
Sent from the Axis - Dev mailing list archive at Nabble.com.