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

Reply via email to