Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 26405 invoked from network); 25 May 2010 14:20:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 May 2010 14:20:30 -0000 Received: (qmail 14323 invoked by uid 500); 25 May 2010 14:20:30 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 14001 invoked by uid 500); 25 May 2010 14:20:29 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 13993 invoked by uid 99); 25 May 2010 14:20:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 14:20:29 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of deepalk@gmail.com designates 209.85.161.45 as permitted sender) Received: from [209.85.161.45] (HELO mail-fx0-f45.google.com) (209.85.161.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 14:20:23 +0000 Received: by fxm10 with SMTP id 10so457455fxm.32 for ; Tue, 25 May 2010 07:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=H8yC6SXBIidsXdgfN5DfRfIZVcAOdKaGygXmGKwxh3E=; b=qb43oMnUl3N/8uKRpA+QN6pfq3ibyN9gC3zwMRmv60jxG5IHyvhUg0fE3EzRgzTZRD 29w1brMXQ+qv55AdcG28oeC4YztZca/3fNHbMv7PChOHvwuJKar1WK6/FvKHWsf02fK6 DmN0uiH8m1Zgd4GQW7tgb/RqqMGk4ySyRKr4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QK/SsopEReK8XhijKnOmVuqWgyakfrrIM1JyWpt9PXY2r1Ayz4Q+jyrHQpTmfZHDF0 8l+od4FBNSpVIj1fcB0NMdG2VhD+7voYQAcEwFpRXB0aNTsUpmEw/5bWsqUDGEdxBaJ3 MCYZKWp7afJzmJQuudJOL3Osnu3WTrSpHgdhg= MIME-Version: 1.0 Received: by 10.223.24.130 with SMTP id v2mr6163972fab.61.1274797203578; Tue, 25 May 2010 07:20:03 -0700 (PDT) Received: by 10.223.107.6 with HTTP; Tue, 25 May 2010 07:20:03 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 May 2010 10:20:03 -0400 Message-ID: Subject: Re: Problem with ServiceClient/ListenerManager From: Deepal Jayasinghe To: java-dev@axis.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hiranya, 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) Deepal 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 =3D 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: > =A0=A0 =A0 =A0 =A0// Initialize transports > =A0=A0 =A0 =A0 =A0ListenerManager transportManager =3D > configContext.getListenerManager(); > =A0=A0 =A0 =A0 =A0if (transportManager =3D=3D null) { > =A0=A0 =A0 =A0 =A0 =A0 =A0transportManager =3D new ListenerManager(); > =A0=A0 =A0 =A0 =A0 =A0 =A0transportManager.init(this.configContext); > =A0=A0 =A0 =A0 =A0} > This in turns initializes transport listeners. However ServiceClient does > not call start on the ListenerManager. Therefore none of the transports g= et > marked as started in the ListenerManager. Now, if I try to use the servic= e > client to invoke a service with useSeparateListener set to true, the > following bit of code in the ClientUtils class is executed: > =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (!listenerManager.isListenerRunning(transportIn.getName())) { > =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0listenerManager.addListener(tra= nsportIn, false); > =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > 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 causin= g > bind exceptions. I'm experiencing this with the TCP transport now. Though= ts? > Thanks, > Hiranya > -- > Hiranya Jayathilaka > Senior Software Engineer; > WSO2 Inc.; =A0http://wso2.org > E-mail: hiranya@wso2.com; =A0Mobile: +94 77 633 3491 > Blog: http://techfeast-hiranya.blogspot.com > --=20 http://blogs.deepal.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org