cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Barber <jon.bar...@acm.org>
Subject Re: DOSGi service still available after being unregistered
Date Mon, 13 May 2013 19:36:50 GMT
Hi,

I applied that patch, built as 1.5.0-SNAPSHOT and loaded into a running
Karaf instance. Same issue - this doesn't seem to fix the problem.

Jon.

On Mon, May 13, 2013, at 04:36 PM, Sergey Beryozkin wrote:
> Hi
> 
> Please watch the following JIRA:
> 
> https://issues.apache.org/jira/browse/DOSGI-177
> 
> it even has a patch attached, so will be fixed for DOSGi 1.5
> 
> Sergey
> On 13/05/13 16:03, Jon Barber wrote:
> > Hi,
> >
> > I have a simple OSGi service I've exposed via CXF DOSGi 1.4.0 using
> > Karaf 2.2.11 - it's pretty much a straight copy from the discovery
> > sample from the 1.4.0 release of cxf-dosgi. The service is exposed by
> > the bundle activator as follows :
> >
> >      private ServiceRegistration reg;
> >
> >      public void start(BundleContext bc) throws Exception {
> >          Dictionary<String, Object>  props = new Hashtable<String,
> >          Object>();
> >
> >          String host = getHostName();
> >          int port = getPort();
> >
> >          String address = getAddress(host,port);
> >          LOG.info("Registering ws address {}",address);
> >
> >          props.put("service.exported.interfaces", "*");
> >          props.put("service.exported.configs", "org.apache.cxf.ws");
> >          props.put("org.apache.cxf.ws.address", address); // old obsolete
> >          value
> >          props.put("endpoint.id", address);
> >
> >          reg = bc.registerService(PingService.class.getName(),
> >                  new SimplePingService(), props);
> >      }
> >
> >      public void stop(BundleContext bc) throws Exception {
> >          LOG.info("Unregistering ping service");
> >
> >          reg.unregister();
> >      }
> >
> >
> > And sure enough it gets registered as a SOAP service and I can see it in
> > zookeeper too. However, when I stop the bundle the service is indeed
> > removed in the local OSGi registry but I can still access the SOAP
> > endpoint, and it's still visible in zookeeper too. Furthermore, if I
> > re-activate the bundle the service is now available on the old endpoint
> > and the new one.
> >
> > So either my understanding is wrong (I would have thought unregistering
> > the service would remove the SOAP service too) or there's a bug in
> > DOSGi, or I'm missing something / doing something wrong.
> >
> > Could someone give some guidance please ?
> >
> > Thanks,
> >
> > Jon.
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/
> 
> Blog: http://sberyozkin.blogspot.com

Mime
View raw message