Hi

Good point, I forgot to destroy the CXF RS server.

I created https://issues.apache.org/jira/browse/KARAF-6523 for the
tracking and I'm fixing that.

Thanks
Regards
JB

On 20/11/2019 00:54, Ranx0r0x wrote:
> I noticed that when I stopped/uninstalled the bundle the CXF endpoint was
> still up and the bundle couldn't be reinstalled. By saving the Server and
> destroying it on @Deactivate it correctly went away. There may be a more
> elegant or better way to do this but it may be that it should be part of the
> sample code.
> 
> @Component
> public class RestServiceBootstrap {
> 
>       private MyInjectedService injectedService;
>       private Server server;
>       @Activate
>       public void activate() throws Exception {
>               System.out.println("Activate the MemberServiceImpl");
>               JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
>               bean.setAddress("/foo");
>               bean.setBus(BusFactory.getDefaultBus());
>               bean.setServiceBean(new RestServiceImpl(injectService));
>               server = bean.create();
>       }
> 
>       @Deactivate
>       public void deactivate() {
>               System.out.println("Deactivating server: " + server);
>               server.destroy();
>       }
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to