Skip to Content.
Sympa Menu

mace-opensaml-users - Problem with "creating SAML object from XML source"

Subject: OpenSAML user discussion

List archive

Problem with "creating SAML object from XML source"


Chronological Thread 
  • From:
  • To:
  • Subject: Problem with "creating SAML object from XML source"
  • Date: Thu, 1 Mar 2007 05:54:29 -0500 (EST)

Hello!

We just started a school project that involves openSAML. We are trying to
understand how the library works and now we are testing the basic
functionality examples we found on opensaml.org.

The "creating SAML object from XML source" example doesnt work for us and we
cant figure out why.


String inCommonMDFile =
"/data/org/opensaml/saml2/metadata/InCommon-metadata.xml";

ParserPoolManager ppMgr = ParserPoolManager.getInstance();

try {
InputStream in =
Builder.class.getResourceAsStream(inCommonMDFile);
Document inCommonMDDoc = ppMgr.parse(in);
Unmarshaller unmarshaller =
Configuration.getUnmarshallerFactory().getUnmarshaller(
inCommonMDDoc.getDocumentElement());

XMLObject inCommonMD =
unmarshaller.unmarshall(inCommonMDDoc.getDocumentElement());

assertEquals("First element of InCommon data was not expected
EntitiesDescriptor", "EntitiesDescriptor",
inCommonMD.getElementQName().getLocalPart());
} catch (XMLParserException xe) {
fail("Unable to parse XML file: " + xe);
} catch (UnmarshallingException ue) {
fail("Unable to unmarshall XML: " + ue);
}


When running this we get a NullPointerException at the
unmarshaller.unmarshall(inCommonMDDoc.getDocumentElement()); line.

What is the problem? Would really appreciate some help getting us started.

Regards / Lars K



Archive powered by MHonArc 2.6.16.

Top of Page