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

loss of data on xpath after cxf (payload-mode)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0, 2.12.0
    • 2.11.2, 2.12.1, 2.13.0
    • camel-cxf
    • None
    • Unknown

    Description

      Applying an xpath expression to a message containing a CxfPayload may lead to loss of data.
      A unit test to demonstrate this, has been written.

      A work around is converting the CxfPayload to a String, followed by applying xpath to the String.

      The unit test fails on current snapshot-version:

      testMessageWithIncreasingSize(org.apache.camel.component.cxf.CxfConsumerPayloadXPathTest) Time elapsed: 1.357 sec <<< FAILURE!
      java.lang.AssertionError: Lengths of testMessage and receiveMessage should be equal (body is CxfPayload), expected:<10000> but was:<3805>
      at org.junit.Assert.fail(Assert.java:88)
      at org.junit.Assert.failNotEquals(Assert.java:743)
      at org.junit.Assert.assertEquals(Assert.java:118)
      at org.junit.Assert.assertEquals(Assert.java:555)
      at org.apache.camel.component.cxf.CxfConsumerPayloadXPathTest.execTest(CxfConsumerPayloadXPathTest.java:131)
      at org.apache.camel.component.cxf.CxfConsumerPayloadXPathTest.testMessageWithIncreasingSize(CxfConsumerPayloadXPathTest.java:109)

      Attachments

        1. DomConverter.patch.txt
          2 kB
          Rene Avontuur
        2. CxfConsumerPayloadXPathTest.java
          6 kB
          Rene Avontuur
        3. CxfConsumerPayloadXPathTest.java
          9 kB
          Rene Avontuur

        Activity

          People

            njiang Willem Jiang
            rene avontuur Rene Avontuur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: