marshallerFactory.getMarshaller(samlToken) returns a "null"

Thomas Lionel SMETS (prof) tsmets at a3-system.eu
Tue Apr 9 06:04:51 EDT 2013


Hello,

I base my code on what I found here :
https://wiki.shibboleth.net/confluence/plugins/viewsource/viewpagesrc.action?pageId=3277019

As I recuperated some code from another project, so from what I could
gather ... it seems I do most things needed like :
[code]
        try {
            DefaultBootstrap.bootstrap();
        } catch (ConfigurationException e) {
            throw new SAMLEngineRuntimeException("Error initializing
Open SAML", e);
        }
[/code]

but the marshaller returned by the "marshallerFactory" is always "null" 
thought listening to the logger "org.opensaml" shows no warning that the
initialization is not OK :(


Here is a Sniplet of "my" code

[code]
public byte[] marshall(final XMLObject samlToken) throws
MarshallingException, ParserConfigurationException, TransformerException {

            if (LOG.isTraceEnabled())
                LOG.trace("Request to marshall : " +
LoggingConstant.START_TRACE_TAG + samlToken.toString() +
LoggingConstant.END_TRACE_TAG);

            javax.xml.parsers.DocumentBuilder docBuilder;
            // Get the marshaller factory
            MarshallerFactory marshallerFactory =
Configuration.getMarshallerFactory();
            // Get the Subject marshaller
            Marshaller marshaller =
marshallerFactory.getMarshaller(samlToken); // marshaller is 'null'
after this statement
            docBuilder = dbf.newDocumentBuilder();
            Document doc = docBuilder.newDocument();
            // Marshall the SAML token
            marshaller.marshall(samlToken, doc); // throws (obviously a
NullPointer)
            ...
[/code]

What step am I missing ???

\T,






-- 
Thomas Lionel SMETS, CISSP (385434)

PGP = FDF0 8FB8 4F37 3F79 1011 05AB 0DCE 9BAB 5DD0 0E10
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20130409/645b6670/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tsmets.vcf
Type: text/x-vcard
Size: 319 bytes
Desc: not available
Url : http://shibboleth.net/pipermail/users/attachments/20130409/645b6670/attachment.vcf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 550 bytes
Desc: OpenPGP digital signature
Url : http://shibboleth.net/pipermail/users/attachments/20130409/645b6670/attachment.bin 


More information about the users mailing list