Loading
Salesforce now sends email only from verified domains. Read More

MuleSoft SAX Parser Error "Content is not allowed in prolog"

Publish Date: Mar 24, 2026
Description

With MuleSoft, you use the SAX parser to parse XML content and get an error like the below in the mule_ee log file:

[Fatal Error] :1:2: Content is not allowed in prolog.
Resolution

The Mule SAX parser error that "Content is not allowed in the prolog" happens when trying to parse XML content that is not valid XML and normally refers to a different encoding or BOM before the XML declaration or invalid text such as:

1. The different encoding causes the error, and it occurs because the file encoding format is not correct.
2. Many text editors auto-add BOM to the UTF-8 file.
3. At the beginning of the XML declaration, any text will cause the "Content is not allowed in prolog" error
 

SOLUTION

1. You might add a JVM system property file.encoding=UTF-8 to ensure that UTF-8 is the encoding format or whatever you need. You can specify -Dfile.encoding=UTF-8 when invoking the application
2. Remove the BOM from the UTF-8 file
3. Delete any text before the XML declaration

Knowledge Article Number

001121683

 
Loading
Salesforce Help | Article