Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 84902 invoked from network); 21 Aug 2009 10:30:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 10:30:02 -0000 Received: (qmail 67527 invoked by uid 500); 21 Aug 2009 10:30:23 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 67439 invoked by uid 500); 21 Aug 2009 10:30:23 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 67429 invoked by uid 99); 21 Aug 2009 10:30:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 10:30:23 +0000 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=SPF_PASS,URI_HEX,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.bosschaert@gmail.com designates 209.85.217.220 as permitted sender) Received: from [209.85.217.220] (HELO mail-gx0-f220.google.com) (209.85.217.220) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 10:30:16 +0000 Received: by gxk20 with SMTP id 20so933318gxk.10 for ; Fri, 21 Aug 2009 03:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=OYqJt+rRFoRc1i37TuF+t6jCZxdsYflp6y/rq8CI7+U=; b=dc4pEY9lwwI7XpERn5y87XqcmQYABsHDs2xJMFeZWMWlMKA2ONsx0jTP9YQJmulAvu 9gkB3ZpPpc3IJdK3n4DHwRxz3/KDpisyuqj9aGur5nXBXKRuXK13qpJiIeLWLS3vpWru 6XZqYJL21dHMzYrVhVYBhAgEm01cLJYKmvZD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=IikB4Hc6GrbehlafNbxluWceiC2G8196Asc6++xd16AwcUxUvuHj2zZRpGBxGRG150 qpO3SaXvdaURon1MPZUBxTR7M1BuVLndJg/8ReJYagegkrF3axzt4f6UO4khsqSwwjve EKAwGhIhTXLNUuW9VegzfexD2sz6HEcz0g1ss= MIME-Version: 1.0 Received: by 10.150.114.1 with SMTP id m1mr1943394ybc.182.1250850595085; Fri, 21 Aug 2009 03:29:55 -0700 (PDT) In-Reply-To: References: <974B0BC4C9F3BB40B2651F8FC12B7B981F94FE20@emss04m12.us.lmco.com> <974B0BC4C9F3BB40B2651F8FC12B7B981FA3C77D@emss04m12.us.lmco.com> <974B0BC4C9F3BB40B2651F8FC12B7B981FAC7708@emss04m12.us.lmco.com> <974B0BC4C9F3BB40B2651F8FC12B7B981FAC7E40@emss04m12.us.lmco.com> From: David Bosschaert Date: Fri, 21 Aug 2009 11:29:35 +0100 Message-ID: Subject: Re: Default endpoint via Zookeeper (D-OSGi) (repost to get its own thread, sorry all) To: users@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Thom, Just to let you know that using two machines I have reproduced your problem= . I'm currently working on a fix. Best regards, David 2009/8/18 David Bosschaert : > Ah, right, and it did work for me because I was trying it out on a > single machine. > Let me go back and try to fix this issue. > > Cheers, > > David > > 2009/8/13 Shulok, Thomas : >> Hi David, >> >> I don't think I explained the problem clearly enough. =A0The node does i= ndeed get registered, but it's missing a property. =A0Instead of doing an l= s on the entry, do a get. =A0Inside the entry, I think you'll see that it's= missing the =A0org.apache.cxf.ws.address property. =A0Without that, the re= mote client will bind to localhost (itself) because it can't find the serve= r. >> >> Thanks, >> Thom >> >> -----Original Message----- >> From: David Bosschaert [mailto:david.bosschaert@gmail.com] >> Sent: Thursday, August 13, 2009 8:37 AM >> To: users@cxf.apache.org >> Subject: Re: Default endpoint via Zookeeper (D-OSGi) (repost to get its = own thread, sorry all) >> >> That works for me too. >> >> I'm now using the following code: >> =A0Dictionary props =3D new Hashtable(); >> >> =A0props.put("service.exported.interfaces", "*"); >> >> =A0reg =3D bc.registerService(DisplayService.class.getName(), new Displa= yServiceImpl(""), props); >> >> Its working fine for me. Could you give it a try? >> >> David >> >> 2009/8/13 Shulok, Thomas : >>> >>> Hi David, >>> >>> Still one difference...I don't specify (the equivalent of) >>> >>> =A0props.put("service.exported.configs", "org.apache.cxf.ws"); >>> >>> in the service decorator. =A0Maybe I've been leveraging some undocument= ed default behavior, but if you just specify the service.exported.interface= s property, the current D-OSGi implementation will assume you want the web = service config and set it up for you. >>> >>> Thanks, >>> Thom >>> -----Original Message----- >>> From: David Bosschaert [mailto:david.bosschaert@gmail.com] >>> Sent: Thursday, August 13, 2009 3:11 AM >>> To: users@cxf.apache.org >>> Subject: Re: Default endpoint via Zookeeper (D-OSGi) (repost to get >>> its own thread, sorry all) >>> >>> Hi Thomas, >>> >>> I changed my copy of the Discovery demo to reflect your situation, and = it seems to work for me. >>> In the file >>> http://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/discovery/impl >>> /src/main/java/org/apache/cxf/dosgi/samples/discovery/impl/Activator.j >>> ava I'm registering my services as follows: >>> =A0Dictionary props =3D new Hashtable(); >>> >>> =A0props.put("service.exported.interfaces", "*"); >>> =A0props.put("service.exported.configs", "org.apache.cxf.ws"); >>> >>> =A0reg =3D bc.registerService(DisplayService.class.getName(), new Displ= ayServiceImpl(""), props); This registers the service under the default nam= e in ZooKeeper, in this case the DefaultService interface name, so if I loo= k in the location for org.apache.cxf.dosgi.samples.discovery.DisplayService= in the ZooKeeper registry I can see my service there: >>> =A0zkCli> ls >>> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery/DisplayS >>> ervice >>> >>> [10.2.4.18#9000##org#apache#cxf#dosgi#samples#discovery#DisplayService >>> ] >>> >>> running the client that is part of this demo works, it can find the ser= vice that is exposed using the defaults. >>> >>> Is this what you're trying to do or am I missing something? >>> >>> David >>> >>> 2009/8/12 Shulok, Thomas : >>>> One bug leads to another... :-) >>>> >>>> Your fix puts the correct endpoint location into the Zookeeper node. = =A0Works great, thanks! =A0But... >>>> >>>> If I don't specify org.apache.cxf.ws.address in the service decorator,= I would expect it to default to http://localhost:9000/fully/qualified/Clas= sName as described in the reference guide (http://cxf.apache.org/distribute= d-osgi-reference.html) under service provider properties. =A0The default wo= uld then get transmorgrified into the actual IP of localhost just like the = endpoint and inserted into the node. =A0Unfortunately, if I don't specify o= rg.apache.cxf.ws.address, it doesn't show up in the Zookeeper node at all, = which means the remote client thinks the web service address is localhost (= i.e. bad). >>>> >>>> Any hope/plan to incorporate the default behavior with the Zookeeper i= ntegration? >>>> >>>> Thanks! >>>> Thom >>>> >>>> -----Original Message----- >>>> From: David Bosschaert [mailto:david.bosschaert@gmail.com] >>>> Sent: Monday, August 10, 2009 6:49 AM >>>> To: users@cxf.apache.org >>>> Subject: Re: Default endpoint via Zookeeper (D-OSGi) (repost to get >>>> its own thread, sorry all) >>>> >>>> Hi Thomas, >>>> >>>> Just to let you know I've just committed a fix for this to trunk (1.1-= SNAPSHOT). The builds should publish a new snapshot of this tonight. >>>> >>>> With this fix you can set the org.apache.cxf.ws.address property to a = localhost value, like this: >>>> =A0props.put("org.apache.cxf.ws.address", >>>> "http://localhost:9100/display"); >>>> >>>> Once it's pushed into the zookeeper server, the localhost and >>>> 127.0.0.1 URLs are changed to contain the real IP address of the host,= like this: >>>> >>>> Hope this works for you too. >>>> zkCli> get >>>> zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery/ >>>> zkCli> D is playService/10.2.4.18#9100##display >>>> # >>>> #Mon Aug 10 14:37:47 BST 2009 >>>> osgi.remote.endpoint.location=3Dhttp\://10.2.4.18\:9100/display >>>> service.id=3D40 >>>> objectClass=3D[Ljava.lang.String;@188f506 >>>> osgi.remote.interfaces=3D* >>>> osgi.remote.configuration.pojo.address=3Dhttp\://10.2.4.18\:9100/displ= a >>>> y >>>> osgi.remote.configuration.type=3Dpojo >>>> osgi.remote.endpoint.id=3Df5a3d0ef-b1f6-4fe4-b03f-33190ec28dab >>>> ... >>>> >>>> Cheers, >>>> >>>> David >>>> >>>> 2009/8/10 David Bosschaert : >>>>> Hi Thomas, >>>>> >>>>> Here are a couple of pointers. >>>>> >>>>> If you look at the Discovery demo, the Service Implementation >>>>> Activator, you can see that in this activator it figures out the >>>>> host name and sets that in the "osgi.remote.configuration.pojo.addres= s" >>>>> property: >>>>> https://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/discovery/i >>>>> m >>>>> p >>>>> l/src/main/java/org/apache/cxf/dosgi/samples/discovery/impl/Activator= . >>>>> java So you could do something similar when setting the property. >>>>> >>>>> However, if you are setting the property from a static file, this >>>>> isn't really convenient. Therefore there is some additional support >>>>> for translating 'localhost' into the machine name/IP addr when its >>>>> registered in Discovery. If you specify the host in your address >>>>> property as 'localhost', the zookeeper code will do a lookup on your >>>>> machine name and register it under that (or the IP address). So in >>>>> my case I'm getting the following registration in ZooKeeper: >>>>> zkCli> ls >>>>> zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery >>>>> zkCli> / >>>>> zkCli> D >>>>> zkCli> isplayService >>>>> =A0[10.2.4.18#9100##display] >>>>> So it translated 'localhost' into 10.2.4.18 >>>>> >>>>> However, looking at the properties inside the registration, I see >>>>> that 'localhost' is still in there: >>>>> zkCli> get >>>>> zkCli> /osgi/service_registry/org/apache/cxf/dosgi/samples/discovery >>>>> zkCli> / D isplayService/10.2.4.18#9100##display >>>>> # >>>>> #Mon Aug 10 10:50:22 BST 2009 >>>>> osgi.remote.endpoint.location=3Dhttp\://localhost\:9100/display >>>>> service.id=3D40 >>>>> objectClass=3D[Ljava.lang.String;@1292ba7 >>>>> osgi.remote.interfaces=3D* >>>>> osgi.remote.configuration.pojo.address=3Dhttp\://localhost\:9100/disp= l >>>>> a >>>>> y >>>>> osgi.remote.configuration.type=3Dpojo >>>>> osgi.remote.endpoint.id=3D464a4c2f-205c-4a06-a5e2-2f5127dc0894 >>>>> ... >>>>> >>>>> So that's clearly a bug, I've filed >>>>> https://issues.apache.org/jira/browse/CXF-2385 and will try to fix >>>>> this over the coming few days. >>>>> >>>>> Hope this helps, >>>>> >>>>> David >>>>> >>>>> 2009/8/7 Shulok, Thomas : >>>>>> Hi All, >>>>>> >>>>>> Working with the Zookeeper discovery setup, and things are working >>>>>> as long as I explicitly specify org.apache.cxf.ws.address in my >>>>>> service decoration xml file. If I don't specify it, it will default >>>>>> to localhost. Not unreasonable, but the problem is, localhost will >>>>>> be the endpoint that gets registered with Zookeeper. So, when >>>>>> another box looks for the interface, Zookeeper will tell it that it = is on localhost (i.e. >>>>>> the client itself), and that will fail. With this setup, do you >>>>>> have to explicitly specify the endpoint, or is there some other >>>>>> default behavior to leverage that will actually use the real IP of >>>>>> the registering localhost when it gets entered into Zookeeper so >>>>>> other clients can find it? >>>>>> >>>>>> Many thanks, >>>>>> >>>>>> Thom >>>>>> >>>>>> >>>>> >>>> >>> >> >