My experience on my daily works... helping others ease each other

Friday, October 22, 2010

org.xml.sax.SAXParseException: Content is not allowed in prolog.

Today while testing my flex applications and try to read xml files using BlazeDS which calls my java class I got this weird errors. When I ran it and test it out on Netbeans or Eclipse, it runs without any issues. But when I port into my webserver (running tomcat), this was pop-up. I run through google looking for solutions. Guest what I got, many of them saying that there is parsing issues when you are using either XML with encoding UTF8 or UTF16. There is a space before your XML starting point

I've try formatting it, validate it and nothing seem correct. and continue to get this errors
Catch Exception XmlConfigReader.readFileColl: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)...

After when through a complete checking on my code, then I realize something... there is issues on my code, it does not find the file as the path is in complete. It point out to folder and not the file thus it is reading a complete folder and just grab the first file and read it. That is why it keep on getting the problem. So guys, if you are getting this problem, check your file and the path it is reading first. :)
Share:

0 comments:

About Me

Somewhere, Selangor, Malaysia
An IT by profession, a beginner in photography

Blog Archive

Blogger templates