You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Евгений Бирюк (Jira)" <ji...@apache.org> on 2021/03/05 10:50:00 UTC

[jira] [Created] (CXF-8433) JAXRSServerFactoryBean remove existing path from destinations on create

Евгений Бирюк created CXF-8433:
----------------------------------

             Summary: JAXRSServerFactoryBean remove existing path from destinations on create
                 Key: CXF-8433
                 URL: https://issues.apache.org/jira/browse/CXF-8433
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 3.4.2
         Environment: __
            Reporter: Евгений Бирюк


When I try to call create method on JAXRSServerFactoryBean for path that already exists, the first time I get the error:
{code:java}
"org.apache.cxf.service.factory.ServiceConstructionException: There is an endpoint already running on ..."{code}
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
{code:java}
try {
 server.start();
} catch (RuntimeException re) {
 server.destroy(); // prevent resource leak
 throw re;
}{code}
 And a little further in the destroy method, the path is removed
{code:java}
public synchronized void removeDestination(String path) {
 this.destinations.remove(path);{code}
Because of what the next call оf the create method will be successful, which is not entirely correct.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)