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

前端 未结 30 1798
别那么骄傲
别那么骄傲 2020-11-22 02:54

I have a Java based web service client connected to Java web service (implemented on the Axis1 framework).

I am getting following exception in my log file:

30条回答
  •  渐次进展
    2020-11-22 03:49

    I was also getting the same

    XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,2] Message: Reference is not allowed in prolog.

    , when my application was creating a XML response for a RestFull Webservice call. While creating the XML format String I replaced the < and > with < and > then the error went off, and I was getting proper response. Not sure how it worked but it worked.

    sample:

    String body = ""
                +sum
                +"";
    

提交回复
热议问题