[
https://issues.apache.org/jira/browse/KARAF-6523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jean-Baptiste Onofré resolved KARAF-6523.
-----------------------------------------
Resolution: Fixed
> Cleanly destroy the CXF server in the REST/SOAP examples
> --------------------------------------------------------
>
> Key: KARAF-6523
> URL: https://issues.apache.org/jira/browse/KARAF-6523
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Priority: Major
> Fix For: 4.3.0, 4.2.8
>
>
> In the karaf-rest-example-scr, we should add {{@Deactivate}} method to
> destroy the CXF RS server.
> It should look like:
> {code:java}
> @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();
> }
> } {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)