Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-3917

CxfPayloadConverter may start failing to convert a CxfPayload to a Node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.1
    • 2.7.3, 2.8.0
    • camel-cxf
    • None
    • Patch Available

    Description

      There is an issue with CxfPayloadConverter that can lead to a failure in converting the CxfPayload into something which is actually convertible.

      This problem happens when you try to convert a CxfPayload instance that has an empty body list into a Node instance. This returns null and subsequently registers this type mapping key (CxfPayload->Node) in org.apache.camel.impl.converter.BaseTypeConverterRegistry's conversion-misses table. Because of this, a subsequent conversion using a CxfPayload instance with an non empty body list will permanently fail.

      I am attaching a modified CxfPayloadConversionTest that includes testCxfPayloadToNode that illustrates this problem. Currently, the last assertion of this test is failing when this issue is present.

      I think we can fix this problem by returning Void.TYPE instead of a null for this case.
      In this way, the conversion is regarded as a success and there will be no entry in the conversion-misses table.

      So, I am also attaching the modiefied CxfPayloadConverter class that can handle this test case.

      Attachments

        1. camel-cxf-20110429-patch.txt
          3 kB
          Akitoshi Yoshida

        Activity

          People

            davsclaus Claus Ibsen
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified