Axiom
  1. Axiom
  2. AXIOM-442

Null pointer exception in MTOM validation

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.12, 1.2.13
    • Fix Version/s: 1.2.14
    • Component/s: DOOM, LLOM
    • Labels:
      None

      Description

      As part of an Axis2 workflow, my code validates incoming messages against schemas. This seems to work in all cases except when the incoming message contains an MTOM attachment.

      The code constructs a Source object for the part of the message to be validated, then calls the "validate" method on a properly constructed javax.xml.validation.Validator object:
      Source validateMe = new OMSource(messagePart);
      validator.validate(validateMe);

      The error generated looks like this:
      java.lang.NullPointerException
      at org.apache.axiom.om.impl.llom.OMTextImpl.getTextCharacters(OMTextImpl.java:272)
      at org.apache.axiom.om.impl.serialize.OMXMLReader.generateEvents(OMXMLReader.java:196)
      at org.apache.axiom.om.impl.serialize.OMXMLReader.generateEvents(OMXMLReader.java:166)
      at org.apache.axiom.om.impl.serialize.OMXMLReader.generateEvents(OMXMLReader.java:163)
      at org.apache.axiom.om.impl.serialize.OMXMLReader.parse(OMXMLReader.java:83)
      at org.apache.axiom.om.impl.serialize.OMXMLReader.parse(OMXMLReader.java:73)
      at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.validate(Unknown Source)
      at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
      at javax.xml.validation.Validator.validate(Unknown Source)


      By the time it reaches my handler, I'm not fully certain what should be in the MTOM attachment element should contain, as it's reasonable to assume that the attachment has been extracted by then. A NullPointerException doesn't seem appropriate, however.

      A logging statement does show the attachment inline, encoded in Base64 (though I believe all incoming MTOM is represented that way if the envelope is printed for a log).

        Activity

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            James Grahn
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development