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

Method getDataHandler() in SAAJ AttachmentPartImpl opens an imput stream internally which is not closed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • om
    • None
    • Java 1.5

    Description

      When the method getDataHandler() in the class org.apache.axis2.saaj.AttachmentPartImpl it checks internally if there is content available by testing whether the getContent() method returns null or not.
      The getContent() method will internally return the content of the datahandler which is the (File)InputStream in my case.
      This InputStream is not closed anymore which results into locked files (until the application exits).

      I think it does not make sense to check if there is really content available - the check if the dataHandler is not null (like it was in the Axis1 implementation) should be enough.

      Attachments

        1. AttachmentPartImpl.diff
          0.7 kB
          Jörg Eichhorn

        Activity

          People

            Unassigned Unassigned
            jeichhorn Jörg Eichhorn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: