Skip to content

Don't fail XML save when sample data contains illegal XML characters - #6767

Open
kalayciburak wants to merge 1 commit into
apache:masterfrom
kalayciburak:fix/6761-woodstox-invalid-xml-chars
Open

kalayciburak wants to merge 1 commit into
apache:masterfrom
kalayciburak:fix/6761-woodstox-invalid-xml-chars

Conversation

@kalayciburak

Copy link
Copy Markdown

Description

Configure the Woodstox XMLOutputFactory used by JMeterStaxDriver to replace characters that are illegal in XML 1.0 (NUL and other C0 controls) instead of aborting the write.

After the xmlpull to Woodstox migration, saving a JTL sample or a JMX test plan that contains those characters throws WstxIOException (Invalid null character / Invalid white space character). Binary request bodies recorded from browsers (for example Mozilla telemetry) hit this path.

Motivation and Context

Fixes #6761

Woodstox's default InvalidCharHandler.FailingHandler rejects those characters. Replacing them with a space keeps the XML well-formed so recording and test-plan save succeed, matching the previous xmlpull behaviour of not failing the save.

How Has This Been Tested?

  • RED then GREEN: ./gradlew :src:core:test --tests org.apache.jmeter.save.SaveServiceInvalidXmlCharTest — 2/0
  • Nearby: ./gradlew :src:core:test --tests org.apache.jmeter.save.SaveServiceInvalidXmlCharTest --tests org.apache.jmeter.save.TestCSVSaveService — 13/0
  • ./gradlew :src:core:style — BUILD SUCCESSFUL

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.

Woodstox rejects NUL and C0 controls by default. Replace them so JTL
recording and JMX save keep working after the xmlpull migration.

Closes apache#6761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant