axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Chinthaka Suriarachchi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-3870) Memory Leak using ServiceClient
Date Thu, 26 Jun 2008 06:44:44 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-3870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608298#action_12608298
] 

Amila Chinthaka Suriarachchi commented on AXIS2-3870:
-----------------------------------------------------

Please see the removeServiceGroup method.
which removes all the services of the service group.

 public AxisServiceGroup removeServiceGroup(String serviceGroupName) throws AxisFault {
        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) getChild(serviceGroupName);
        if (axisServiceGroup == null) {
            throw new AxisFault(Messages.getMessage("invalidservicegroupname",
                                                    serviceGroupName));
        }
        Iterator services = axisServiceGroup.getServices();
        while (services.hasNext()) {
            AxisService axisService = (AxisService) services.next();
            allServices.remove(axisService.getName());
            if (!axisService.isClientSide()) {
                notifyObservers(AxisEvent.SERVICE_REMOVE, axisService);
            }
        }
        removeChild(serviceGroupName);
        notifyObservers(AxisEvent.SERVICE_REMOVE, axisServiceGroup);
        return axisServiceGroup;
    }

I tested with this client.
ConfigurationContext configurationContext =
                    ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                            AXIS2_REPOSITORY_LOCATION, AXIS2_CLIENT_CONFIG_FILE);
            ServiceClient serviceClient = new ServiceClient(configurationContext, null);
            serviceClient.setTargetEPR(new EndpointReference("http://localhost:8088/axis2/services/PlainTestInOutService"));
            serviceClient.getOptions().setAction("urn:PlainTestInOutOperation");
            OMElement response = serviceClient.sendReceive(getTestOMElement("test"));

            System.out.println("OMElement ==> " + response.toString());
            serviceClient.cleanup();
            try {
                System.out.println("Waiting thread to sleep");
                Thread.sleep(2000);
            } catch (InterruptedException e) {

here I put a debug point at serviceClient.cleanup() method and checked. before this statement
there was a service and after that it has removed.



> Memory Leak using ServiceClient
> -------------------------------
>
>                 Key: AXIS2-3870
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3870
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.4
>            Reporter: Hans G Knudsen
>         Attachments: ClientLeak.java
>
>
> Hi!
> I think I see a leak when using ServiceClient.
> In my client I intialize the ConfigurationContext once and resuse it to initialize the
ServiceClient :
>             ServiceClient sender = new ServiceClient(configContext,null);
> Calling 'cleanup()' on the ServiceClinet explicitly after the service call does not help..
> I will supply a small testcase.
> /hans 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message