0

I am trying to automate weekly generation of a database. As a first step in this process, I need to obtain a set of files from network location M:\. The process is as follows:

  1. Delete any possibly remaining old source files from my local folder (REMOVE_OLD_FILES).
  2. Obtain the names of the required files using regular expressions (GET_FILES).
  3. Copy the files from the network location to my local folder for further processing (COPY/MOVE FILES)

The acquistion process

Step 3 is where I run into trouble, I frequently receive the below error:

Error processing files. Exception : org.apache.commons.vfs.FileNotFoundException: Could not read from "file:///M:/FILESOURCE/FILENAME.zip" because it is a not a file.

However, when I manually locatae the 'erroneous' file on the network location and try to open or copy it, there are no problems. If I then re-run the Spoon job, no errors occur for this file (although the next file might lead to an error).

So far, I have verified that steps 1 and 2 run correctly: more specifically, there are no errors in the file names returned from step 2.

Obviously, I would prefer not having to manually open all the files first to ensure that Spoon can correctly copy them. Does anyone have an idea what might be causing this behaviour?

For completeness, below are the parameters selected in the COPY/MOVE FILES step.

File copy dialog

Wouter Kuijsters
  • 840
  • 6
  • 20

2 Answers2

2

I was facing same issue with different clients and finally i tried with some basic approach and it got resolved. It might help in your case as well.

Also, other users can follow this rule.

Just try this: Create all required folder with Spoon Job "Create a Folder" and inactive/delete those hops from your job or transformation once your folders are created.

This is because, user you are using to delete the file/s is not recognized as Windows User. Once your folder is in place you can remove "Create a Folder" steps from your Job.

Job Created to Delete a File

0

The path to the file is wrong. If you are running spoon in a Windows environment you should use the Windows format for filepaths. Try changing from

"file:///M:/FILESOURCE/FILENAME.zip"

To

"M:\FILESOURCE\FILENAME.zip"

By the way, it will only work if M: is an actual drive in the machine. If you want to access a file in the network you should use the network path to the shared folder, this way:

"\\MachineName\M$\FILESOURCE\FILENAME.zip"

or

"\\MachineName\FILESOURCE\FILENAME.zip"

If you try to access a file in a network mounted drive it won't work.

t3b4n
  • 603
  • 9
  • 23