Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8433

JAXRSServerFactoryBean remove existing path from destinations on create

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.2
    • Fix Version/s: 3.5.0, 3.4.3, 3.3.10
    • Component/s: JAX-RS
    • Labels:
      None
    • Environment:

      __

    • Estimated Complexity:
      Unknown

      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.

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Yue Fang
              Reporter:
              berek Евгений Бирюк
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: