users@jaxb.java.net

Re: Odd error unmarshalling with SOAP

From: Kasia Trapszo <kasia_at_trapszo.com>
Date: Wed, 19 Apr 2006 21:09:54 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That works now, thank you.

The class is oracle.j2ee.ws.saaj.soap.soap11.BodyElement11 using oc4j.


On Apr 17, 2006, at 8:09 PM, Kohsuke Kawaguchi wrote:

> Kasia Trapszo wrote:
>> When I try to unmarshall a SOAPElement, I get a null pointer
>> exception,
>> (stack trace follows). If I convert that element to string then
>> unmarshall the string, it works perfectly fine. Has anyone
>> encountered
>> this before?
>
> Interesting. The relevant code is:
>
>> /**
>> * Recursively visit ancestors and build up {_at_link
>> NamespaceSupport} oject.
>> */
>> private void buildNamespaceSupport(NamespaceSupport nss, Node
>> node) {
>> if(!(node instanceof Element))
>> return;
>> buildNamespaceSupport( nss, node.getParentNode
>> () );
>> nss.pushContext();
>> NamedNodeMap atts = node.getAttributes();
>> for( int i=0; i<atts.getLength(); i++ ) {
>> Attr a = (Attr)atts.item(i);
>> if( "xmlns".equals(a.getPrefix()) ) {
>> nss.declarePrefix( a.getLocalName(), a.getValue() );
>> continue;
>> }
>> if( "xmlns".equals(a.getName()) ) {
>> nss.declarePrefix( "", a.getValue() );
>> continue;
>> }
>> }
>> }
>
> ... and therefore I think the only possibility is either a bug in
> SAAJ, or it might be a DOM object implementing multiple DOM
> interfaces (it must be implementing an Element but not behaving as
> one, as it returns null from the getAttributes method.
>
> I changed
>
> > if(!(node instanceof Element))
>
> to:
>
>> if(node.getNodeType()!=Node.ELEMENT_NODE)
>
> so try tonight's nightly build.
>
> If you can attach a debugger to this point and tell us which class
> is "node", that would be very helpful.
>
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (Darwin)

iD8DBQFERt9l06QY0YjI75QRAgyMAJwMDMyV9X+ED3AFsFct9E13JhTG0wCfQDWB
5sA5Q+IrYVIP2vsB0vnapH0=
=kiyo
-----END PGP SIGNATURE-----