0
Not a bug

XML UnmarshalException: Content is not allowed in prolog

Howard Durdle 8 years ago updated 8 years ago 5

On launching Ubooquity with a pre-existing preferences.xml file, xml error occurs:


javax.xml.bind.UnmarshalException

- with linked exception:
[org.xml.sax.SAXParseException; systemId: file:/D:/#DLApps/ubooquity/preferences.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.]

This occurs even if no preferences have been changed.


It can be reproduced (reliably) by:

  • On Windows Server 2012 R2 x64 + Java 8 Update 91 (32 bit):
  • Launch Ubooquity version 1.10.1
  • Ubooquity creates the preferences.xml
  • Stop and Exit Ubooquity
  • Launch Ubooquity again.
  • On launch as Ubooquity loads the preferences.xml it just created, receive the error as above.

I can configure Ubooquity to scan and serve my files - and it works beautifully - but as soon as Ubooquity restarts for any reason, the above error is generated.


The error can be related to the BOM in a UTF-8 file, but not sure what I can do to influence that. Posting in Bugs, but willing to learn that this is an environmental issue that can be sorted in my config.


Thanks!

Under review

Ubooquity is not supposed to write a BOM at the beginning of the preferences file.

Are you positive there is one in yours ?

Hi Tom,


Sorry, my bad, that was just one theory I've seen re: the content not allowed in prolog error. I've confirmed that Ubooquity is not saving the file with a BOM.

In any case, you're right about the meaning of the error: there is some unauthorized character at the beginning of the file, before the XML content

So you can either open the file with an hexadecimal editor to take a look, or you can send it to me (tom at vaemendis dot net) and I'll take a look.

+1
Not a bug

I opened your file with an hex editor: there is no character (BOM or other) before the usual XML content.

I also launched Ubooquity using your file, without triggering any error.


So I still have no idea of the cause of the problem.


Ok, just found it: the problem comes from the "#" character in your folder name.

I don't know why (problem is inside Jaxb, the internal XML library used by Java), but I was able to reproduce the problem that way.


Just remove the "#" and it will work fine



Perfect. I moved the ubooquity directory out of that directory and all is well. Thanks v. much!