Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3384

The character ' is not normalized in class DOMWriter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • JBossAS-4.0.4.GA
    • Other
    • None
    • All operating system and software platform

    • Low

      Problem:
      ---------

      The following soap message should parsed by JBossWS/JBoss 4.04GA

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <oms:ExecuteResponse xmlns:oms="http://omsoe.crm.tmobile.net/services/oms">
      <data>
      <ReturnValue code="NOT_VALID" validationErrors="invalid XML <xml-fragment xmlns:ins="http://omsoe.crm.tmobile.net/datatypes/ccoscks/installakz&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:oms="http://omsoe.crm.tmobile.net/services/oms&quot; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/&quot;/>: Expected elements 'contractNumber iccid msisdn' before the end of the content in element contractIdentificator " />
      </data>
      </oms:ExecuteResponse>
      </soap:Body>
      </soap:Envelope>

      The following exception "caused by: java.io.IOException: org.xml.sax.SAXParseException: Element type "ReturnValue" must be followed by either attribute specifications, ">" or "/>"." is thrown by JBoss.

      Analysis:
      ---------
      The problem is caused by the XML attribute expression:

      validationErrors="invalid XML ... Expected elements 'contractNumber iccid msisdn' before the end of the content..."

      JBoss performs the following steps:

      (1) Converting the soap xml snippet(see above) from XML in a DOM document
      (2) Converting DOM document in the xml snippet with the following result:

      validationErrors='invalid XML ... Expected elements 'contractNumber iccid msisdn' before the end of the content'

      The XML attribute value is not wellformed because the embedded ' character is not allowed. The bug is caused by the class "org.jboss.util.xml.DOMWriter.java".
      The character ' is not normalized in the methode: private String normalize(String s).

      Solution:
      ---------

      The following code snippet has added in the case statement of the method normalize():

      case '\'':

      { str.append("'"); break; }

              Unassigned Unassigned
              moegenbu Dirk Moegenburg (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 30 minutes
                  30m
                  Remaining:
                  Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified