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

Attempted read on closed stream. on

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Incomplete
    • 1.6.4
    • None
    • kernel
    • None

    Description

      Hello Axis2 team,

       

      While using the API to read the file chunks., we get the error "

      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)

      "

       

      We are currently using axis2 1.6.4, for our feature. the complete stack trace is given below. We also use MTOM. Can you please let us know if there is a fix already available. We have also tried the approaches 

       

      Approach 1 : disable the chunking mechanism.

                              This I have tried by setting of below code. But Still not working we are getting the same error.

      Options options = new Options();

      options.setProperty(HTTPConstants.CHUNKED, "false");

      this.getStub()._getServiceClient().setOverrideOptions(options);

       

      Approach 2 : disabling the MTOM option which mentioned in the link : https://jira.apache.org/jira/browse/AXIS2-5487

                            Still it is not working we are getting the same error. Also disable the MTOM options from service.xml which is there in the federation services.

       

      but still the issue is unresolved. Kindly get back to us with the solution, as this is a critical issue with our customers.

      Thanks,

      Veera

       

       

                     org.apache.axiom.attachments.PartImpl||IOException occurred after reading 3877 bytes in 1 chunks

      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:143)

                     at org.apache.axiom.om.util.DetachableInputStream.read(DetachableInputStream.java:147)

                     at org.apache.james.mime4j.io.BufferedLineReaderInputStream.fillBuffer(BufferedLineReaderInputStream.java:111)

                     at org.apache.james.mime4j.io.MimeBoundaryInputStream.fillBuffer(MimeBoundaryInputStream.java:223)

                     at org.apache.james.mime4j.io.MimeBoundaryInputStream.read(MimeBoundaryInputStream.java:157)

                     at org.apache.james.mime4j.io.BufferedLineReaderInputStream.fillBuffer(BufferedLineReaderInputStream.java:111)

                     at org.apache.james.mime4j.io.BufferedLineReaderInputStream.read(BufferedLineReaderInputStream.java:158)

                     at org.apache.james.mime4j.io.LineReaderInputStreamAdaptor.read(LineReaderInputStreamAdaptor.java:67)

                     at org.apache.axiom.attachments.DebugInputStream.read(DebugInputStream.java:98)

                     at org.apache.axiom.blob.MemoryBlobOutputStream.readFrom(MemoryBlobOutputStream.java:78)

                     at org.apache.axiom.blob.MemoryBlobImpl.readFrom(MemoryBlobImpl.java:64)

                     at org.apache.axiom.attachments.PartImpl.fetch(PartImpl.java:198)

                     at org.apache.axiom.attachments.PartImpl.getContent(PartImpl.java:152)

                     at org.apache.axiom.attachments.PartImpl.getInputStream(PartImpl.java:248)

                     at org.apache.axiom.attachments.PartDataSource.getInputStream(PartDataSource.java:44)

                     at javax.activation.DataHandler.getInputStream(DataHandler.java:238)

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            veeraraghavan.raman Veeraraghavan Raman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: