Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1657

CheckFaultInterceptor causes XMLStreamReader to throw IllegalState at doc end

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.2, 2.0.9
    • Component/s: Soap Binding
    • Labels:
      None

      Description

      From handleMessage():
      :
      try {
      // advance to first tag.
      int x = xmlReader.getEventType();
      while (x != XMLStreamReader.START_ELEMENT
      && x != XMLStreamReader.END_ELEMENT
      && xmlReader.hasNext())

      { x = xmlReader.next(); }
      } catch (XMLStreamException e) { throw new SoapFault(new Message("XML_STREAM_EXC", LOG), e, message.getVersion().getSender()); }
      if (message.getVersion().getFault().equals(xmlReader.getName())) {
      :
      In the case where hasNext() == false (e.g. document end) will cause the subsequent call to xmlReader.getName() to throw an IllegalStateException, as per the javax.xml.stream,XMLStreamReader interface. It would seem the appropriate response would be to simply return in this case:

      :
      try {
      // advance to first tag.
      int x = xmlReader.getEventType();
      while (x != XMLStreamReader.START_ELEMENT
      && x != XMLStreamReader.END_ELEMENT
      && xmlReader.hasNext()) { x = xmlReader.next(); }

      if ( x==XMLStreamReader.END_DOCUMENT) return;
      } catch (XMLStreamException e) {
      :

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              jaysonraymond Jayson Raymond

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment