org.xml.sax.SAXParseException: Content is not allowed in prolog
The error org.xml.sax.SAXParseException: Content is not allowed in prolog
usually indicates that there is some content before the XML prolog in the file you are trying to parse. The prolog is the part of the XML document that specifies the version of XML and the encoding used, and it should be the first thing in the file.
For example, the following XML file would trigger this error because there is a space before the prolog:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element>Some content</element>
</root>
To fix this error, make sure that there is no content before the prolog in the XML file. The prolog should be the very first thing in the file, with no leading spaces or other characters.
Here's an example of a correct XML file with the prolog as the first thing:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element>Some content</element>
</root>