Skip to Content.
Sympa Menu

mace-opensaml-users - org.xml.sax.SAXParseException: Content is not allowed in prolog

Subject: OpenSAML user discussion

List archive

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


Chronological Thread 
  • From: Jason Pedone <>
  • To:
  • Subject: org.xml.sax.SAXParseException: Content is not allowed in prolog
  • Date: Mon, 20 Sep 2004 12:26:24 -0700 (PDT)

All,

I'm trying to convert a base64 encoded SAML String
response into a SAMLResponse object, the code I am
executing to do so follows:

SAMLResponse obj_SAMLResponse = null;
if(str_SAMLResponse != null) {
try {
byte[] byte_arr_decodedBase64 =
Base64.decode(str_SAMLResponse);
obj_SAMLResponse = new SAMLResponse(
new
java.io.ByteArrayInputStream(byte_arr_decodedBase64));
} catch (SAMLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Base64DecodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

I am getting the following exception:

[http-8080-Processor41] ERROR opensaml.SAMLObject
fromStream - caught an exception while parsing a
stream:
Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed
in prolog.
at org.opensaml.SAMLObject.fromStream(Unknown Source)
at org.opensaml.SAMLResponse.<init>(Unknown Source)

anyone have any ideas on what could cause this? I
know the exception means that there are some
unexpected characters before the root node, however I
print out the unencoded xml before I encode it and
there is nothing preceeding the root node. Its a
little hard to debug where I am decoding it b/c all I
have at that point is the base64 encoded SAML.

Thanks In Advance,

Jason P.



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com



Archive powered by MHonArc 2.6.16.

Top of Page