You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by St...@faa.gov on 2015/06/17 15:48:13 UTC

NPE when calling SamlAssertionWrapper.toDOM(null)

In migrating some code up to WSS4J 2.1 (from 1.6.17), I'm getting an unexpected NullPointerException where I previously did not. When calling this:

Node content = sa.toDOM(null); // sa is a SamlAssertionWrapper

I get this:

Caused by: java.lang.NullPointerException
                at org.opensaml.core.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:74)
                at org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:170)
                at org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:142)
                at org.apache.wss4j.common.saml.SamlAssertionWrapper.toDOM(SamlAssertionWrapper.java:271)

In previous versions, I'd have issues when I'd forget to call OpenSAMLUtil.initSamlEngine(), but I am definitely doing that now during startup. Adding an InitializationService.initialize(); from OpenSAML 3 doesn't change anything. Is there some additional initialization that is needed that I am missing?

Thanx,

Stephen W. Chappell

RE: NPE when calling SamlAssertionWrapper.toDOM(null)

Posted by St...@faa.gov.
Colm - that appears to have done the trick, thanx!

Stephen W. Chappell


-----Original Message-----
From: Colm O hEigeartaigh [mailto:coheigea@apache.org] 
Sent: Thursday, June 18, 2015 6:42 AM
To: users@cxf.apache.org
Cc: users@ws.apache.org
Subject: Re: NPE when calling SamlAssertionWrapper.toDOM(null)

It's caused by a bug in WSS4J that I've just fixed. In the meantime, you can just create a new empty Document + pass that instead to toDOM().

Colm.

On Wed, Jun 17, 2015 at 2:48 PM, <St...@faa.gov> wrote:

> In migrating some code up to WSS4J 2.1 (from 1.6.17), I'm getting an 
> unexpected NullPointerException where I previously did not. When 
> calling
> this:
>
> Node content = sa.toDOM(null); // sa is a SamlAssertionWrapper
>
> I get this:
>
> Caused by: java.lang.NullPointerException
>                 at
> org.opensaml.core.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:74)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:170)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:142)
>                 at
> org.apache.wss4j.common.saml.SamlAssertionWrapper.toDOM(SamlAssertionW
> rapper.java:271)
>
> In previous versions, I'd have issues when I'd forget to call 
> OpenSAMLUtil.initSamlEngine(), but I am definitely doing that now 
> during startup. Adding an InitializationService.initialize(); from 
> OpenSAML 3 doesn't change anything. Is there some additional 
> initialization that is needed that I am missing?
>
> Thanx,
>
> Stephen W. Chappell
>



--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

RE: NPE when calling SamlAssertionWrapper.toDOM(null)

Posted by St...@faa.gov.
Colm - that appears to have done the trick, thanx!

Stephen W. Chappell


-----Original Message-----
From: Colm O hEigeartaigh [mailto:coheigea@apache.org] 
Sent: Thursday, June 18, 2015 6:42 AM
To: users@cxf.apache.org
Cc: users@ws.apache.org
Subject: Re: NPE when calling SamlAssertionWrapper.toDOM(null)

It's caused by a bug in WSS4J that I've just fixed. In the meantime, you can just create a new empty Document + pass that instead to toDOM().

Colm.

On Wed, Jun 17, 2015 at 2:48 PM, <St...@faa.gov> wrote:

> In migrating some code up to WSS4J 2.1 (from 1.6.17), I'm getting an 
> unexpected NullPointerException where I previously did not. When 
> calling
> this:
>
> Node content = sa.toDOM(null); // sa is a SamlAssertionWrapper
>
> I get this:
>
> Caused by: java.lang.NullPointerException
>                 at
> org.opensaml.core.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:74)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:170)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:142)
>                 at
> org.apache.wss4j.common.saml.SamlAssertionWrapper.toDOM(SamlAssertionW
> rapper.java:271)
>
> In previous versions, I'd have issues when I'd forget to call 
> OpenSAMLUtil.initSamlEngine(), but I am definitely doing that now 
> during startup. Adding an InitializationService.initialize(); from 
> OpenSAML 3 doesn't change anything. Is there some additional 
> initialization that is needed that I am missing?
>
> Thanx,
>
> Stephen W. Chappell
>



--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: NPE when calling SamlAssertionWrapper.toDOM(null)

Posted by Colm O hEigeartaigh <co...@apache.org>.
It's caused by a bug in WSS4J that I've just fixed. In the meantime, you
can just create a new empty Document + pass that instead to toDOM().

Colm.

On Wed, Jun 17, 2015 at 2:48 PM, <St...@faa.gov> wrote:

> In migrating some code up to WSS4J 2.1 (from 1.6.17), I'm getting an
> unexpected NullPointerException where I previously did not. When calling
> this:
>
> Node content = sa.toDOM(null); // sa is a SamlAssertionWrapper
>
> I get this:
>
> Caused by: java.lang.NullPointerException
>                 at
> org.opensaml.core.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:74)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:170)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:142)
>                 at
> org.apache.wss4j.common.saml.SamlAssertionWrapper.toDOM(SamlAssertionWrapper.java:271)
>
> In previous versions, I'd have issues when I'd forget to call
> OpenSAMLUtil.initSamlEngine(), but I am definitely doing that now during
> startup. Adding an InitializationService.initialize(); from OpenSAML 3
> doesn't change anything. Is there some additional initialization that is
> needed that I am missing?
>
> Thanx,
>
> Stephen W. Chappell
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: NPE when calling SamlAssertionWrapper.toDOM(null)

Posted by Colm O hEigeartaigh <co...@apache.org>.
It's caused by a bug in WSS4J that I've just fixed. In the meantime, you
can just create a new empty Document + pass that instead to toDOM().

Colm.

On Wed, Jun 17, 2015 at 2:48 PM, <St...@faa.gov> wrote:

> In migrating some code up to WSS4J 2.1 (from 1.6.17), I'm getting an
> unexpected NullPointerException where I previously did not. When calling
> this:
>
> Node content = sa.toDOM(null); // sa is a SamlAssertionWrapper
>
> I get this:
>
> Caused by: java.lang.NullPointerException
>                 at
> org.opensaml.core.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:74)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:170)
>                 at
> org.apache.wss4j.common.saml.OpenSAMLUtil.toDom(OpenSAMLUtil.java:142)
>                 at
> org.apache.wss4j.common.saml.SamlAssertionWrapper.toDOM(SamlAssertionWrapper.java:271)
>
> In previous versions, I'd have issues when I'd forget to call
> OpenSAMLUtil.initSamlEngine(), but I am definitely doing that now during
> startup. Adding an InitializationService.initialize(); from OpenSAML 3
> doesn't change anything. Is there some additional initialization that is
> needed that I am missing?
>
> Thanx,
>
> Stephen W. Chappell
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com