Details
Description
When I try to call create method on JAXRSServerFactoryBean for path that already exists, the first time I get the error:
"org.apache.cxf.service.factory.ServiceConstructionException: There is an endpoint already running on ..."
Which is correct, because this path is already taken. But if I call the same method for the same path a second time, then no error occurs.
This happens due to the fact that when the server starts unsuccessfully, it is destroyed
try { server.start(); } catch (RuntimeException re) { server.destroy(); // prevent resource leak throw re; }
And a little further in the destroy method, the path is removed
public synchronized void removeDestination(String path) { this.destinations.remove(path);
Because of what the next call оf the create method will be successful, which is not entirely correct.