Camel
  1. Camel
  2. CAMEL-5405

CXF Transport loses HTTP Matrix parameters

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.2
    • Fix Version/s: 2.9.3, 2.10.1, 2.11.0
    • Component/s: camel-cxf
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice

      Description

      DefaultCxfMesssageMapper (note the typo - to be fixed in a follow-up JIRA) wrongly initializes CXF Message Message.REQUEST_URI property with the value of Camel Exchange.HTTP_PATH, even though Camel Exchange.HTTP_URI is available.

      The net effect is that the HTTP matrix parameters if any attached to the last HTTP path segment are lost. Another side-effect is that Exchange.HTTP_PATH will contain the decoded value (done at HTTPServletRequest level) which can lead to the matching issues at the JAX-RS level.

      A simple patch is attached

      1. camel5405.diff
        5 kB
        Sergey Beryozkin
      2. camel5405_2.diff
        3 kB
        Sergey Beryozkin

        Activity

        Hide
        Sergey Beryozkin added a comment -

        I'll get the test done asap, still committed to it; I'm not sure it is needed though for this issue, propagating HTTP Servlet references is needed for some of our demos to work but it is useful irrespectively of that; please feel free to close this issue.

        Show
        Sergey Beryozkin added a comment - I'll get the test done asap, still committed to it; I'm not sure it is needed though for this issue, propagating HTTP Servlet references is needed for some of our demos to work but it is useful irrespectively of that; please feel free to close this issue.
        Hide
        Claus Ibsen added a comment -

        Any update on this. If a new test is needed then create a new ticket as we need this ticket to be in the changelog for upcoming releases.

        Show
        Claus Ibsen added a comment - Any update on this. If a new test is needed then create a new ticket as we need this ticket to be in the changelog for upcoming releases.
        Hide
        Willem Jiang added a comment -

        Hi Sergey,

        I will keep this issue open until we get the integration test committed .

        Show
        Willem Jiang added a comment - Hi Sergey, I will keep this issue open until we get the integration test committed .
        Hide
        Sergey Beryozkin added a comment -

        Btw, propagating servlet request/response will also make sure that they can be injected as JAX-RS Context objects or accessed as JAX-WS properties, so the fix is good

        Show
        Sergey Beryozkin added a comment - Btw, propagating servlet request/response will also make sure that they can be injected as JAX-RS Context objects or accessed as JAX-WS properties, so the fix is good
        Hide
        Sergey Beryozkin added a comment -

        Hi Willem - thanks for applying it. This will fix one of our failing demos.
        I can promise here I'll take an action and work on creating an integration test. It may take a bit of time - I'm mostly offline till the end of next week, but I'll get it done.
        Cheers

        Show
        Sergey Beryozkin added a comment - Hi Willem - thanks for applying it. This will fix one of our failing demos. I can promise here I'll take an action and work on creating an integration test. It may take a bit of time - I'm mostly offline till the end of next week, but I'll get it done. Cheers
        Hide
        Willem Jiang added a comment -

        @Sergey,

        I just applied the patch into the trunk, it could be great if you can provide an integration test to show the whole story .

        Show
        Willem Jiang added a comment - @Sergey, I just applied the patch into the trunk, it could be great if you can provide an integration test to show the whole story .
        Hide
        Sergey Beryozkin added a comment -

        HttpServletRequest and HttpServletResponse are also propagated, without introducing CXF HTTP Transport or Servlet API dependencies

        Show
        Sergey Beryozkin added a comment - HttpServletRequest and HttpServletResponse are also propagated, without introducing CXF HTTP Transport or Servlet API dependencies
        Hide
        Sergey Beryozkin added a comment -

        Propagating the actual Request URI causes the mis-match at the CXF level when Camel Servlet is also used. For example, Camel Servlet will set Request URI as "/webapp/HelloWorld", but also set the base URI as "servlet:///HelloWorld".
        To calculate the base address, CXF needs HttpServletRequest propagated too

        Show
        Sergey Beryozkin added a comment - Propagating the actual Request URI causes the mis-match at the CXF level when Camel Servlet is also used. For example, Camel Servlet will set Request URI as "/webapp/HelloWorld", but also set the base URI as "servlet:///HelloWorld". To calculate the base address, CXF needs HttpServletRequest propagated too
        Hide
        Willem Jiang added a comment -

        Applied patch into trunk, 2.9.x and 2.8.x branch with thanks to Sergey.
        I also added ASL header for the test file.

        Show
        Willem Jiang added a comment - Applied patch into trunk, 2.9.x and 2.8.x branch with thanks to Sergey. I also added ASL header for the test file.

          People

          • Assignee:
            Willem Jiang
            Reporter:
            Sergey Beryozkin
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development