Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-775

Positive preliminary response from server when using FTPSender to send multiple files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.1
    • servicemix-ftp
    • None
    • Windows XP Professional

    Description

      I was trying to have scenario of polling directory for files and sending this files to FTP server using FTPSender. However, subsequent files are not being sent. First file is send then next one is created with zero size.

      When debugging FTPSender I saw that OutputStream is null for subsequent message. That's because FTPClient doesn't create socket. FTPClient checks if there is positive preliminary response from server (number between 100 -> 199). If there is - it's returning null value.

      API for FTPClient is suggesting to invoke completePendingCommand() after output stream is closed (http://jakarta.apache.org/commons/net/api/org/apache/commons/net/ftp/FTPClient.html#completePendingCommand()). After I invoke that - servicemix started to work.

      [FTPSender.process(MessageExchange exchange, NormalizedMessage message)]
      [...]
      finally {
      returnClient(client);
      if (out != null) {
      try

      { out.close(); }

      catch (IOException e)

      { e.printStackTrace(); }

      [...]
      }
      client.completePendingCommand();
      }

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            rience Krzysztof Adamski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified