Hi guys,

I have a JAXB object generated by xsdtojava in CXF that has the
following attribute:

@XmlAnyElement(lax = true)
protected Object any;

This has a setAny accessor with the comment that the allowed object
argument is a DOM Element or an Object. However, I get the following
error when I assign a DOM Element to "any", and the JAXB object gets
marshalled out:

SEVERE: EXCEPTION 
java.lang.AssertionError
com.sun.xml.bind.v2.runtime.output.NamespaceContextImpl.declareNsUri(Nam
espaceContextImpl.java:189)
...
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshaller
Impl.java:75)
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.ja
va:378)
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:
154)
...

Has anyone ever tried doing anything similar, or does it even make sense
to do so? I need to preserve the DOM Element "as is", as it's a signed
SAML assertion. I'd rather avoid having to manually marshal the JAXB
object itself to DOM, and then insert the "any" in the right place, if
at all possible.

Thanks,

Colm.

Reply via email to