You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Dr. Java (JIRA)" <xa...@xml.apache.org> on 2007/08/18 02:18:31 UTC

[jira] Created: (XALANJ-2396) NullPointerException serializing a SOAPPart document

NullPointerException serializing a SOAPPart document
----------------------------------------------------

                 Key: XALANJ-2396
                 URL: https://issues.apache.org/jira/browse/XALANJ-2396
             Project: XalanJ2
          Issue Type: Bug
          Components: Serialization
    Affects Versions: 2.7
            Reporter: Dr. Java


When trying to serialize a SOAPPart document using the SUN "Soap w/ Attachments API" (saaj 1.3), I get a NullPointerException in DOM3TreeWalker.serializeAttList (line 678).

Sample code looks like this:
	protected void doConversion(final SOAPMessage message)
		throws Exception
	{
		LSSerializer serializer = this.impl.createLSSerializer();
                LSOutput output = impl.createLSOutput();
                StringWriter w = new StringWriter();
                output.setCharacterStream(w);
		serializer.write(message.getSOAPPart(), output);
	}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2396) NullPointerException serializing a SOAPPart document

Posted by "Dr. Java (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526430 ] 

Dr. Java commented on XALANJ-2396:
----------------------------------

SAAJ ppl say they cannot fix this w/o proper test case.

Since SAAJ relies on Sun-JAXP which is a fork of Xerces2, could it be that this behaviour is from an older bug in Xerces?
https://saaj.dev.java.net/issues/show_bug.cgi?id=26

> NullPointerException serializing a SOAPPart document
> ----------------------------------------------------
>
>                 Key: XALANJ-2396
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2396
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.7
>            Reporter: Dr. Java
>         Attachments: serializeAttributes_npe.patch
>
>
> When trying to serialize a SOAPPart document using the SUN "Soap w/ Attachments API" (saaj 1.3), I get a NullPointerException in DOM3TreeWalker.serializeAttList (line 678).
> Sample code looks like this:
> 	protected void doConversion(final SOAPMessage message)
> 		throws Exception
> 	{
> 		LSSerializer serializer = this.impl.createLSSerializer();
>                 LSOutput output = impl.createLSOutput();
>                 StringWriter w = new StringWriter();
>                 output.setCharacterStream(w);
> 		serializer.write(message.getSOAPPart(), output);
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2396) NullPointerException serializing a SOAPPart document

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521418 ] 

Henry Zongaro commented on XALANJ-2396:
---------------------------------------

I discussed this with Michael Glavassevich and Neil Delima, who are Xerces-J developers.  They agreed that Attr.getSchemaTypeInfo() should never return null.  Michael said, "The DOM spec is very explicit about which methods can return null and under what circumstances."  In the cases of Attr.getSchemaTypeInfo() and Element.getSchemaTypeInfo(), there are no statements indicating that the methods are permitted to return null, so they are not permitted to do so.

This problem should be rerouted to SAAJ.

> NullPointerException serializing a SOAPPart document
> ----------------------------------------------------
>
>                 Key: XALANJ-2396
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2396
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.7
>            Reporter: Dr. Java
>         Attachments: serializeAttributes_npe.patch
>
>
> When trying to serialize a SOAPPart document using the SUN "Soap w/ Attachments API" (saaj 1.3), I get a NullPointerException in DOM3TreeWalker.serializeAttList (line 678).
> Sample code looks like this:
> 	protected void doConversion(final SOAPMessage message)
> 		throws Exception
> 	{
> 		LSSerializer serializer = this.impl.createLSSerializer();
>                 LSOutput output = impl.createLSOutput();
>                 StringWriter w = new StringWriter();
>                 output.setCharacterStream(w);
> 		serializer.write(message.getSOAPPart(), output);
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2396) NullPointerException serializing a SOAPPart document

Posted by "Dr. Java (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521425 ] 

Dr. Java commented on XALANJ-2396:
----------------------------------

Understood, but wouldn't you like to include the patch anyways? I think one should always program defensively and play it safe IMHO. And you already have the patch...

Anyways, created bug entry with SAAJ as well: https://saaj.dev.java.net/issues/show_bug.cgi?id=26


> NullPointerException serializing a SOAPPart document
> ----------------------------------------------------
>
>                 Key: XALANJ-2396
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2396
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.7
>            Reporter: Dr. Java
>         Attachments: serializeAttributes_npe.patch
>
>
> When trying to serialize a SOAPPart document using the SUN "Soap w/ Attachments API" (saaj 1.3), I get a NullPointerException in DOM3TreeWalker.serializeAttList (line 678).
> Sample code looks like this:
> 	protected void doConversion(final SOAPMessage message)
> 		throws Exception
> 	{
> 		LSSerializer serializer = this.impl.createLSSerializer();
>                 LSOutput output = impl.createLSOutput();
>                 StringWriter w = new StringWriter();
>                 output.setCharacterStream(w);
> 		serializer.write(message.getSOAPPart(), output);
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2396) NullPointerException serializing a SOAPPart document

Posted by "Dr. Java (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520732 ] 

Dr. Java commented on XALANJ-2396:
----------------------------------

Here is a fix for DOM3TreeWalker (sry, no patch ATM):

            // Determine the Attr's type.
            String type = null;
            if (fIsLevel3DOM) {
            	TypeInfo tInfo = ((Attr) attr).getSchemaTypeInfo();
            	type = (tInfo != null)
            						? tInfo.getTypeName()
            						: null;
            }
            type = type == null ? "CDATA" : type;


> NullPointerException serializing a SOAPPart document
> ----------------------------------------------------
>
>                 Key: XALANJ-2396
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2396
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions: 2.7
>            Reporter: Dr. Java
>
> When trying to serialize a SOAPPart document using the SUN "Soap w/ Attachments API" (saaj 1.3), I get a NullPointerException in DOM3TreeWalker.serializeAttList (line 678).
> Sample code looks like this:
> 	protected void doConversion(final SOAPMessage message)
> 		throws Exception
> 	{
> 		LSSerializer serializer = this.impl.createLSSerializer();
>                 LSOutput output = impl.createLSOutput();
>                 StringWriter w = new StringWriter();
>                 output.setCharacterStream(w);
> 		serializer.write(message.getSOAPPart(), output);
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org