axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal Jayasinghe <>
Subject Re: Problem with ServiceClient/ListenerManager
Date Tue, 25 May 2010 14:20:03 GMT

I will give you a detailed answer later (now I do not have access to
the source code), here is what I remember. As I remember correct when
you first initialize the transport it only adds to the HashMap, and
when you want to start it just start the entry in the Hasmap. So
nothing harm happen, this code is around 4 years now and haven't seen
any problem, so I believe code works fine (but need to double check,
as I said before I will double check and let you know more about it)


On Tue, May 25, 2010 at 10:07 AM, Hiranya Jayathilaka
<> wrote:
> Hi Folks,
> While debugging through the TCP test cases, I stumbled upon a little
> problem. Let's say somebody creates a ServiceClient instance as follows:
> ServiceClient sender = new ServiceClient(configContext, clientService);
> When this is called, internally it will initialize a ListenerManager
> instance. I found the following bit of code in the ServiceClient:
>         // Initialize transports
>         ListenerManager transportManager =
> configContext.getListenerManager();
>         if (transportManager == null) {
>             transportManager = new ListenerManager();
>             transportManager.init(this.configContext);
>         }
> This in turns initializes transport listeners. However ServiceClient does
> not call start on the ListenerManager. Therefore none of the transports get
> marked as started in the ListenerManager. Now, if I try to use the service
> client to invoke a service with useSeparateListener set to true, the
> following bit of code in the ClientUtils class is executed:
>                 if
> (!listenerManager.isListenerRunning(transportIn.getName())) {
>                     listenerManager.addListener(transportIn, false);
>                 }
> The if condition evaluates to true since the listener has not been marked as
> started. In addListener method the corresponding transport listener will be
> initialized again. If an endpoint has been configured globally, this can
> result in the same endpoint getting started twice thus potentially causing
> bind exceptions. I'm experiencing this with the TCP transport now. Thoughts?
> Thanks,
> Hiranya
> --
> Hiranya Jayathilaka
> Senior Software Engineer;
> WSO2 Inc.;
> E-mail:;  Mobile: +94 77 633 3491
> Blog:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message