Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-2104

StreamingOMSerializer.serializeElement cannot handle empty namespace prefix aka default namespace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.1
    • None
    • om
    • None

    Description

      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;
      String namespace = (String) writeNSList.get;
      ========> if (prefix != null)

      { <<<<<<<<======= writer.writeNamespace(prefix, namespace); }

      else

      { writer.writeDefaultNamespace(namespace); }

      }
      }

      Fix is easy: Replace marked section with:

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

      Attachments

        Activity

          People

            deepal Deepal Jayasinghe
            vreichel Volker Reichel
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: