Problem while reading file from remote FTP location

Hello,

I am using UniversalDataReader for reading files from FTP server. I am giving url in the form
ftp://username:password@192.145.125.200 … leFile.txt. I am getting exception as file is unreachable

Reason: FileURL attribute (ftp://username:password@192.145.125.200/amit/sampleFile.txt) doesn't contain valid file url.
	at org.jetel.graph.Phase.init(Phase.java:159)
	at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:423)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:177)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:62)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.lang.Thread.run(Thread.java:619)
Caused by: [attribute = fileURL]-FileURL attribute (ftp://username:password@192.145.125.200/amit/sampleFile.txt) doesn't contain valid file url.
	at org.jetel.util.MultiFileReader.init(MultiFileReader.java:117)
	at org.jetel.component.DataReader.init(DataReader.java:267)
	at org.jetel.graph.Phase.init(Phase.java:154)
	... 6 more
Caused by: org.jetel.exception.JetelException: File is unreachable: ftp://username:password@192.145.125.200/amit/sampleFile.txt caused by: java.io.FileNotFoundException: amit/inventory-bro.txt
	at org.jetel.util.ReadableChannelIterator.createReadableByteChannel(ReadableChannelIterator.java:418)
	at org.jetel.util.ReadableChannelIterator.next(ReadableChannelIterator.java:275)
	at org.jetel.util.MultiFileReader.nextSource(MultiFileReader.java:219)
	at org.jetel.util.MultiFileReader.init(MultiFileReader.java:111)
	... 8 more
Caused by: java.io.FileNotFoundException: amit/inventory-bro.txt
	at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:441)
	at org.jetel.util.file.FileUtils.getAuthorizedStream(FileUtils.java:493)
	at org.jetel.util.file.FileUtils.getInputStream(FileUtils.java:259)
	at org.jetel.util.file.FileUtils.getReadableChannel(FileUtils.java:205)
	at org.jetel.util.ReadableChannelIterator.createReadableByteChannel(ReadableChannelIterator.java:414)
	... 11 more

Please provide some solution to this problem. I am also reading xml files using XMLExtract and I want to read those also from FTP location. Will XMLExtract works for reading xml files from ftp authorized locations , if not then is there any way to read it from ftp.

Thanks
Pushpendra

Your URL seems correct to me, not sure what is the problem. I have forwarded this to Clover’s support team ( support@opensys.com ).

Anyway, any reader/component which contains fileURL attribute should be able to read data through any of the supported protocols:

  • ftp
  • sftp
  • http
  • https

Therefore XMLExtract should be able to read data (XML) through FTP protocol.

Hello,
this exception suggests that the file really doesn’t exist. Please check the file existence and the path one more time.
And what CloverETL version do you use?
Can you show the definition of your reader node?

Hi Agata,

File exists at the given FTP location and I am using clover 2.7.2 java api.
Using the Universal Data Reader node, I am able to read file using file and http protocol but it is not working in case of FTP.

Thanks
Pushpendra

I can’t reproduce the problem. Reading by ftp works properly in 2.7 as well as in 2.8 version. Try to connect to ftp server from command line and check if file really exist.