Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0
-
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
catch (IOException e)
{ e.printStackTrace(); }[...]
}
client.completePendingCommand();
}