Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: incubation
    • Fix Version/s: 3.0.1, 3.1
    • Component/s: servicemix-http
    • Labels:
      None
    • Environment:

      Linux, jdk 1.5 sun

    • Patch Info:
      Patch Available

      Description

      i am using sm build from 2006/09/12.
      I am trying to deploy 2 SUs in sm-http.

      the first one has the following path :
      locationURI="http://localhost:8192/junit_HttpEndpoint_invokeUtilTester"

      the second :
      locationURI="http://localhost:8192/junit_HttpEndpoint_invoke"

      I get the following exception :
      The requested context for path '/junit_HttpEndpoint_invoke' overlaps
      with an existing context for path: '/junit_HttpEndpoint_invokeUtilTester'

      I had a look at the code in
      org.apache.servicemix.http.jetty.JettyContextManager at line 138 (the
      method where is thrown the exception) and I found very strange the
      following test :

      if (h.getContextPath().startsWith(path) ||
      path.startsWith(h.getContextPath())) {
      throw new Exception("The requested context for path '" + path + "'
      overlaps with an existing context for path: '" + h.getContextPath() + "'");
      }

      h is a handler which represents an already deployed path
      (/junit_HttpEndpoint_invokeUtilTester).
      path is the current path (being deployed = /junit_HttpEndpoint_invoke)

      The exception is thrown as the following is true I think :
      h.getContextPath().startsWith(path)

      I can deploy another su having the following path without any error:
      /junit_HttpEndpoint_incrementService

      This let me thinking that there could have a matching region but one
      could not be completely included in another...

      PATCH :

      replace
      if (h.getContextPath().startsWith(path) ||
      path.startsWith(h.getContextPath())) {

      by

      if (h.getContextPath().equals(path)) {

        Activity

        Hide
        Guillaume Nodet added a comment -

        I slightly disagree with this fix because you should not be able to deploy the following endpoints:
        /path1
        /path1/path2

        However you should be able to deploy as you have tried
        /path1
        /path1path2

        The fix is maybe:
        if ( (h.getContextPath() + "/").startsWith(path + "/") || (path + "/").startsWith(h.getContextPath() + "/") ) {

        Thoughts ?

        Show
        Guillaume Nodet added a comment - I slightly disagree with this fix because you should not be able to deploy the following endpoints: /path1 /path1/path2 However you should be able to deploy as you have tried /path1 /path1path2 The fix is maybe: if ( (h.getContextPath() + "/").startsWith(path + "/") || (path + "/").startsWith(h.getContextPath() + "/") ) { Thoughts ?
        Hide
        Guillaume Nodet added a comment -

        Author: gnodet
        Date: Mon Sep 25 01:24:27 2006
        New Revision: 449602

        URL: http://svn.apache.org/viewvc?view=rev&rev=449602
        Log:
        SM-583: Jetty context Path verification

        Modified:
        incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
        incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java

        Author: gnodet
        Date: Mon Sep 25 01:24:28 2006
        New Revision: 449603

        URL: http://svn.apache.org/viewvc?view=rev&rev=449603
        Log:
        SM-583: Jetty context Path verification

        Modified:
        incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
        incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java

        Show
        Guillaume Nodet added a comment - Author: gnodet Date: Mon Sep 25 01:24:27 2006 New Revision: 449602 URL: http://svn.apache.org/viewvc?view=rev&rev=449602 Log: SM-583 : Jetty context Path verification Modified: incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java Author: gnodet Date: Mon Sep 25 01:24:28 2006 New Revision: 449603 URL: http://svn.apache.org/viewvc?view=rev&rev=449603 Log: SM-583 : Jetty context Path verification Modified: incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java incubator/servicemix/trunk/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
        Hide
        Charles Souillard added a comment -

        [[ Old comment, sent by email on Thu, 21 Sep 2006 08:51:24 +0200 ]]

        Guillaume,
        I think you are right.

        Your fix seems to respect your examples.
        I didn't know that the following

        /path1
        /path1/path2
        were forbidden

        Charles

        Show
        Charles Souillard added a comment - [[ Old comment, sent by email on Thu, 21 Sep 2006 08:51:24 +0200 ]] Guillaume, I think you are right. Your fix seems to respect your examples. I didn't know that the following /path1 /path1/path2 were forbidden Charles

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            charles SOUILLARD
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development