Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exception from OLB Service:org.xml.sax.SAXParseException: Content is not allowed in prolog.  RSS feed

 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Am trying to hit the service which has been generated using apache cxf 3.0, I have generated the client using axis2 wsdl2java and whenever I tried to hit the service am getting as "exception from OLB Service:org.xml.sax.SAXParseException: Content is not allowed in prolog."

Not sure about the cause of the issue. We have made interceptors on the server side to verify whether there is any special characters associated, but there are no such characters from provider.

I would be glad if I get a help.

 
Paul Clapham
Sheriff
Posts: 22480
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That normally means there are characters before the start of the XML document. Even whitespace is illegal there (and that's the most likely thing for you to generate accidentally). Your document should start with a < character; whether that's the first character of the prolog or the first character of the root element's start tag, it doesn't matter.
 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have parsed my response in local and tested (please note I have done the server part too). I didn't receive any exception.

Response XML is fine in the server end. But in the client side they are receiving the exception
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly how are you transmitting the XML document from the server to the client?

As Paul said it is very likely you are accidentally creating leading characters.

Bill
 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh, might be, but not sure, as we have developed and deployed the service in play framework, the request flows in through a play server and routes file is the one acts as an interface between all the request and response, am not sure whether it get transformed over there, as am new to play network.

Also for your information I have the logged the request and response which flows in and did a parser too, where I didn't face any issue.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what "play framework" is or does so my only other suggestion is that instead of the expected XML document, your client is getting an error message formatted in HTML from the server because of addressing problems. This happened to me once - very confusing.

Are you confirming that the request is getting to the right place in the server every time?

Bill
 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is confirmed, all the request are getting flowed into server, which is my local desktop and we don't have any other place where the code has been deployed.

It is weird for me too.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!