Hi, I didnt mention that it is a springboot app. With a more deep search, I have found the answer here. <https://stackoverflow.com/questions/45161045/camel-cxf-with-spring-boot-manual-starting-route>
PS: why shouldnt instantiate a new CxfRsComponent if I reference the camel context in it? Le ven. 5 avr. 2019 à 09:41, Zoran Regvart <zo...@regvart.com> a écrit : > Hi Damien, > I think the point of the Camel and Wildfly integration is to have the > lifecycle managed by the application server, from the excerpt you > provided there is an additional lifecycle on top of that. I don't > think you should be instantiating new CxfRsComponent instance, that > component instance should be managed by Wildfly through Wildfly Camel. > > Perhaps you can take a look at the examples in the > wildfly-camel-examples repository[1] and base your implementation on > that. > > zoran > > [1] > https://github.com/wildfly-extras/wildfly-camel-examples/tree/master/camel-cxf-jaxrs > > On Wed, Apr 3, 2019 at 2:44 PM Damien Nicolas <dmn.nico...@gmail.com> > wrote: > > > > Hello, > > I am developping a CXF Rest service using Camel and deployed on a JBoss > EAP > > 7.1 server. > > My service works perfectly, but when I undeploy the application, the HTTP > > server used for CXF is still active, so when I want to reupload my > > application I get a "bind already exists..." exception. > > > > Shutting down the port corresponding to the CXF server with fuser (for > > example) kills the JBoss server (which is not ... suitable). > > > > > > Using : > > > > try { > > CxfRsComponent component = new CxfRsComponent(getContext()); > > // TODO change address to "localhost" for testing > > endpoint = new CxfRsEndpoint("http://myserver:10011/rest/", > component); > > endpoint.setProvider(jsonProvider); > > endpoint.addResourceClass(InformationController.class); > > > > > from(endpoint).routeId("REST_ID").process(ProcessorIdentifier.FRONT_REPLIER); > > } catch (Exception e) { > > LOG.debug(e.getMessage(), e); > > } > > > > with a ServletContextListner: > > > > @Override > > public void contextDestroyed(ServletContextEvent servletContextEvent) { > > LOG.debug("context destroyed!"); > > > > try { > > endpoint.stop(); > > endpoint.getBus().shutdown(true); > > } catch (Exception e) { > > LOG.debug(e.getMessage(), e); > > } > > } > > > > does not work too. > > > > What could I do to remove this server without killing JBoss? > > > > Thanks > > > > -- > Zoran Regvart > -- Damien NICOLAS