SAXParseException: Content is not allowed in prolog

前端 未结 2 1135
逝去的感伤
逝去的感伤 2020-12-20 18:19

I need to add the following file to my Tomcat\'s \'/conf\' directory:




        
2条回答
  •  别那么骄傲
    2020-12-20 19:02

    Your xml file has some invisible chars (most likely the BOM) at the start (before ) which is not allowed in xml. you could view it using a hex editor. Simplest way to fix it is to create an empty text file and copy the content into it, change the extension to xml.

    Check this answer for further help.

    From http://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html

    UTF8 file are a special case because it is not recommended to add a BOM to them because it can break other tools like Java. In fact, Java assumes the UTF8 don't have a BOM so if the BOM is present it won't be discarded and it will be seen as data.

提交回复
热议问题