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

WstxIOException when trying to retrieve inbound envelope from last operation message context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.5.1
    • None
    • None
    • None
    • Java 1.7, Ubuntu 12.10

    Description

      When using the Axis2 client stub to get the last operation's inbound envelope, a WstxIOException is thrown (see below for stack trace).

      This is occurring with very simple and basic Axis2 code:

      stub._getServiceClient().getLastOperationContext().getMessageContext("In").getEnvelope().toString();

      The odd thing is that there is no problem when getting the outbound envelope.

      Stacktrace is shown here:

      org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.
      at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:260)
      at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:337)
      at org.apache.axiom.om.impl.traverse.OMChildrenIterator.next(OMChildrenIterator.java:102)
      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:953)
      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:227)
      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:937)
      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:387)
      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1106)
      at Main.main(Main.java:29)
      Caused by: com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.
      at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:683)
      at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
      at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:88)
      at org.apache.axiom.om.impl.builder.SafeXMLStreamReader.next(SafeXMLStreamReader.java:183)
      at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:597)
      at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
      ... 9 more
      Caused by: java.io.IOException: Attempted read on closed stream.
      at org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:183)
      at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:107)
      at java.io.FilterInputStream.read(FilterInputStream.java:133)
      at org.apache.axiom.om.util.DetachableInputStream.read(DetachableInputStream.java:147)
      at java.io.FilterInputStream.read(FilterInputStream.java:133)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:186)
      at java.io.FilterInputStream.read(FilterInputStream.java:107)
      at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:365)
      at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:110)
      at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
      at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
      at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
      at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:967)
      at com.ctc.wstx.sr.StreamScanner.getNext(StreamScanner.java:738)
      at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2721)
      at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
      ... 13 more

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gumho Ryan H
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: