The FTP scanner does not run properly when I include either of the two following properties in config.properties:
ftpOutFolder
localBackupFolder
Here are some error messages:
<2005-03-08 16:25:41,890> ERROR [myftp] : [ScannerWorker.process] Error scannin
g...
com.babeldoc.scanner.ScannerException: Error connecting to ftp
at com.babeldoc.scanner.worker.FtpScanner.doScan(Unknown Source)
at com.babeldoc.scanner.ScannerWorker.process(Unknown Source)
at com.babeldoc.scanner.ScannerThread.run(Unknown Source)
Caused by: com.babeldoc.scanner.ScannerException: Error connecting to ftp
at com.babeldoc.scanner.worker.FtpScanner.processFtpFolder(Unknown Sourc
e)
... 3 more
Caused by: com.babeldoc.scanner.ScannerException: Message not available
at com.babeldoc.scanner.worker.FtpScanner.processFile(Unknown Source)
... 4 more
Caused by: java.lang.NullPointerException
... 5 more
If I don't include either of the aforementioned properties, the ftp scanner is working fine for me.
Thanks,
Bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This was happening because I did not specify the 'ftpFolder' property (because the files are being dropped in the root folder), so the 'ftpFolder' field ends up being null. Here is the line in FtpScanner where the exception occurs (in the processFile(String fileName) method)
The FTP scanner does not run properly when I include either of the two following properties in config.properties:
ftpOutFolder
localBackupFolder
Here are some error messages:
<2005-03-08 16:25:41,890> ERROR [myftp] : [ScannerWorker.process] Error scannin
g...
com.babeldoc.scanner.ScannerException: Error connecting to ftp
at com.babeldoc.scanner.worker.FtpScanner.doScan(Unknown Source)
at com.babeldoc.scanner.ScannerWorker.process(Unknown Source)
at com.babeldoc.scanner.ScannerThread.run(Unknown Source)
Caused by: com.babeldoc.scanner.ScannerException: Error connecting to ftp
at com.babeldoc.scanner.worker.FtpScanner.processFtpFolder(Unknown Sourc
e)
... 3 more
Caused by: com.babeldoc.scanner.ScannerException: Message not available
at com.babeldoc.scanner.worker.FtpScanner.processFile(Unknown Source)
... 4 more
Caused by: java.lang.NullPointerException
... 5 more
If I don't include either of the aforementioned properties, the ftp scanner is working fine for me.
Thanks,
Bob
This was happening because I did not specify the 'ftpFolder' property (because the files are being dropped in the root folder), so the 'ftpFolder' field ends up being null. Here is the line in FtpScanner where the exception occurs (in the processFile(String fileName) method)
String localPath =
localBackupFolder + fileName.substring(ftpFolder.length());
The files we are interested in are dropped in the root folder of our FTP site, so I slightly modified the initialize() method in FtpScanner:
ftpFolder = this.getInfo().getStrValue(FTP_FOLDER);
// my code
if (ftpFolder == null) {
ftpFolder = "";
}
Now we can process files without specifying the ftpFolder property
I will add this fix to CVS