You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Volker Reichel (JIRA)" <ji...@apache.org> on 2007/02/03 19:39:05 UTC

[jira] Created: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
-------------------------------------------------------------------------------------------------

                 Key: AXIS2-2104
                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: om
    Affects Versions: 1.1.1
            Reporter: Volker Reichel


When serializing XML a default namespace will throw a NPE in method serializeElement().



       // Now write out the list of namespace declarations in this list that we constructed
    	// while doing the "set" processing.
    	if (writePrefixList != null) {
        	for (int i=0; i<writePrefixList.size(); i++) {
        		String prefix = (String) writePrefixList.get(i);
        		String namespace = (String) writeNSList.get(i);	
 ========>  if (prefix != null) {   <<<<<<<<=======
            		writer.writeNamespace(prefix, namespace);
            	} else {
            		writer.writeDefaultNamespace(namespace);
            	}
        	}
        }


Fix is easy:  Replace marked section with:

if ( ! "".equals(prefix)) {


-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

Posted by "Jose Antonio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496852 ] 

Jose Antonio commented on AXIS2-2104:
-------------------------------------

I see this is not fixed in Axis2 1.2. Is it planed for Axis2 1.2.1 or 1.3? That bug doesn't let me upgrade to something newer than Axis2 1.1.

> StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2104
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>            Reporter: Volker Reichel
>         Assigned To: Deepal Jayasinghe
>
> When serializing XML a default namespace will throw a NPE in method serializeElement().
>        // Now write out the list of namespace declarations in this list that we constructed
>     	// while doing the "set" processing.
>     	if (writePrefixList != null) {
>         	for (int i=0; i<writePrefixList.size(); i++) {
>         		String prefix = (String) writePrefixList.get(i);
>         		String namespace = (String) writeNSList.get(i);	
>  ========>  if (prefix != null) {   <<<<<<<<=======
>             		writer.writeNamespace(prefix, namespace);
>             	} else {
>             		writer.writeDefaultNamespace(namespace);
>             	}
>         	}
>         }
> Fix is easy:  Replace marked section with:
> if ( ! "".equals(prefix)) {

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-2104:
----------------------------------------

    Assignee: Deepal Jayasinghe

> StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2104
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>            Reporter: Volker Reichel
>         Assigned To: Deepal Jayasinghe
>
> When serializing XML a default namespace will throw a NPE in method serializeElement().
>        // Now write out the list of namespace declarations in this list that we constructed
>     	// while doing the "set" processing.
>     	if (writePrefixList != null) {
>         	for (int i=0; i<writePrefixList.size(); i++) {
>         		String prefix = (String) writePrefixList.get(i);
>         		String namespace = (String) writeNSList.get(i);	
>  ========>  if (prefix != null) {   <<<<<<<<=======
>             		writer.writeNamespace(prefix, namespace);
>             	} else {
>             		writer.writeDefaultNamespace(namespace);
>             	}
>         	}
>         }
> Fix is easy:  Replace marked section with:
> if ( ! "".equals(prefix)) {

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas resolved AXIS2-2104.
-------------------------------------

    Resolution: Fixed

Volker,

We fixed the namespace being null issue yesterday, could not create the prefix being null issue so far. Please upload a sample and we will reopen this bug.

thanks,
dims

> StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2104
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>            Reporter: Volker Reichel
>         Assigned To: Deepal Jayasinghe
>
> When serializing XML a default namespace will throw a NPE in method serializeElement().
>        // Now write out the list of namespace declarations in this list that we constructed
>     	// while doing the "set" processing.
>     	if (writePrefixList != null) {
>         	for (int i=0; i<writePrefixList.size(); i++) {
>         		String prefix = (String) writePrefixList.get(i);
>         		String namespace = (String) writeNSList.get(i);	
>  ========>  if (prefix != null) {   <<<<<<<<=======
>             		writer.writeNamespace(prefix, namespace);
>             	} else {
>             		writer.writeDefaultNamespace(namespace);
>             	}
>         	}
>         }
> Fix is easy:  Replace marked section with:
> if ( ! "".equals(prefix)) {

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

Posted by "Volker Reichel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470037 ] 

Volker Reichel commented on AXIS2-2104:
---------------------------------------

The problem goes away  when "elementFormDefault" is set to "qualified" and "attributeFormDefault" is set to "unqualified".



> StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2104
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>            Reporter: Volker Reichel
>
> When serializing XML a default namespace will throw a NPE in method serializeElement().
>        // Now write out the list of namespace declarations in this list that we constructed
>     	// while doing the "set" processing.
>     	if (writePrefixList != null) {
>         	for (int i=0; i<writePrefixList.size(); i++) {
>         		String prefix = (String) writePrefixList.get(i);
>         		String namespace = (String) writeNSList.get(i);	
>  ========>  if (prefix != null) {   <<<<<<<<=======
>             		writer.writeNamespace(prefix, namespace);
>             	} else {
>             		writer.writeDefaultNamespace(namespace);
>             	}
>         	}
>         }
> Fix is easy:  Replace marked section with:
> if ( ! "".equals(prefix)) {

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2104) StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

Posted by "Volker Reichel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469977 ] 

Volker Reichel commented on AXIS2-2104:
---------------------------------------

There's another problem which shows up when 'namespace' is null.

So the fix is:

       // Now write out the list of namespace declarations in this list that we constructed
     // while doing the "set" processing.
     if (writePrefixList != null) {
         for (int i=0; i<writePrefixList.size(); i++) {
         String prefix = (String) writePrefixList.get(i);
         String namespace = (String) writeNSList.get(i);
         if (! "".equals(prefix) && namespace != null) {
             writer.writeNamespace(prefix, namespace);
         } else {
             if (namespace != null) {
                    writer.writeDefaultNamespace(namespace);
             } else {
// namespace == null should not occur!!
             }
         }
      }
    }


 

> StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace
> -------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-2104
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2104
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>            Reporter: Volker Reichel
>
> When serializing XML a default namespace will throw a NPE in method serializeElement().
>        // Now write out the list of namespace declarations in this list that we constructed
>     	// while doing the "set" processing.
>     	if (writePrefixList != null) {
>         	for (int i=0; i<writePrefixList.size(); i++) {
>         		String prefix = (String) writePrefixList.get(i);
>         		String namespace = (String) writeNSList.get(i);	
>  ========>  if (prefix != null) {   <<<<<<<<=======
>             		writer.writeNamespace(prefix, namespace);
>             	} else {
>             		writer.writeDefaultNamespace(namespace);
>             	}
>         	}
>         }
> Fix is easy:  Replace marked section with:
> if ( ! "".equals(prefix)) {

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org