Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7594

XmlUtil.serialize is not processing whole message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.3.7
    • None
    • XML Processing
    • None
    • Linux (Virtual Machine)

    Description

      Consider following code snippet:

      def writer = new FileWriter(some_file_path)
      def xmll = new StreamingMarkupBuilder().bind {
      root {
      //datarows = quite large chunk of data that I have, structured in rows
      datarows.each { row ->
      datarow()

      { //6 fields definitions here }

      }
      }
      writer << XmlUtil.serialize(xmll)

      when printing xmll (as in: log.info ... ), the message is correct (i.e. I have loooooong xml string with proper data); however, when I check the output file of the writer, it is missing a significant part of data (I have, like, around first 40% of the datarows, or first <8k characters out of 20k total), and it looks as if the buffer ended (but no exception was thrown nor warning) because the last record/line looks like this:
      <datarowhere>
      <somefield>SOME_DATA_INSIDE</somef

      Attachments

        Activity

          People

            paulk Paul King
            thasar Tomasz Nowak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: