[resolved] tfilecopy inconsistent behavior

Hi,
I have a job
tfilelist-->tfilearchive-->tfilecopy
there is an inconsistent behaviour of tfilecopy component. It works fine but sometimes it gives following error and the job stops:
Exception in component tFileCopy_1
java.lang.RuntimeException: The source File "abc.csv" does not exist or is not a file.
source destination= ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
I have to restart the job and it starts working fine. Anything i am missing here?
I am using Talend 4.2.2

Regards
Asif
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] tfilecopy inconsistent behavior

Hi Asif
Link tFileUnarchive with tFileCopy by OncomponentOK.
Regards,
Pedro
10 REPLIES
One Star

Re: [resolved] tfilecopy inconsistent behavior

Hi Asif
According to source destination in tFileCopy, you want to copy original files from tFileList.
Why do you put tFileUnArchive between tFileList and tFileCopy?
How do you link tFileUnArchive with tFileCopy?

Regards,
Pedro

Re: [resolved] tfilecopy inconsistent behavior

Hi Pedro,
The job I mentioned works like tfileunarchive unzips the files in tfilelist and then successfully unzipped files are moved to another destination.
tfilelist---iterate-->tfileunarchive---iterate--->tfilecopy
One Star

Re: [resolved] tfilecopy inconsistent behavior

Hi
Got it.
In post #1, you say the component is tFileArchive...
The expression in tFileCopy should be as follow.
((String)globalMap.get("tFileUnarchive_1_CURRENT_FILEPATH"))

Regards,
Pedro

Re: [resolved] tfilecopy inconsistent behavior

Hi Pedro,
Sorry must the typo in post#1...will check this way and let you know what it turns out. Thanks : )
Regards
Asif

Re: [resolved] tfilecopy inconsistent behavior

Hi Pedro,
It turned out to be moving the unarchived files instead to zip files. I wanted to move the zips files that are successfuly unziped using tfileunzip.
Regards
Asif
One Star

Re: [resolved] tfilecopy inconsistent behavior

Hi Asif
If you want to move the zips files that are successfully upziped, why does the exception is "The source File "abc.csv" does not exist or is not a file"?
It should be like "abc.zip"...
SO. I want to know your accurate requirement.
Maybe you want this job in the image???
Regards,
Pedro

Re: [resolved] tfilecopy inconsistent behavior

Hi Pedro,
Apologies for not providing the correct requirements at first place. Actualy I am using the same job as you mentioned in the image which unzips the files and move the actual zips to another location. The job in the image works absolutely fine but sometimes it gives error "The source File "abc.zip" does not exist or is not a file" at tfilecopy. Which when restarted goes well again.
The error occurs at random sometimes goes ends well sometimes it doesnt for the same files.

Regards
Asif

Re: [resolved] tfilecopy inconsistent behavior

Here is the image for the job I am currently using with tfilecopy source destination= ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
One Star

Re: [resolved] tfilecopy inconsistent behavior

Hi Asif
Link tFileUnarchive with tFileCopy by OncomponentOK.
Regards,
Pedro

Re: [resolved] tfilecopy inconsistent behavior

Thanks Pedro, it worked Smiley Happy