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