Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Null pointer exception in Tftpfile_exist component

I have a scenario where I have to check on ftp directory,and if its empty trigger an email. I've tried using component tftpfile_exist with

if condition - !((Boolean)globalMap.get("tFileExist_1_EXISTS")) but on running the job it returns

Exception in component tFTPFileExist_1 (dummy)
java.lang.NullPointerException
at demo.dummy_0_1.dummy.tFTPFileExist_1Process(dummy.java:404)
at demo.dummy_0_1.dummy.runJobInTOS(dummy.java:895)
at demo.dummy_0_1.dummy.main(dummy.java:745)

 

I've tried using tftp_list too but same error occurs.

Thanks in advance

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Do you use any variables on tFTPFileExist component? Can you please upload a screenshot of basic settings of tFTPFileExist?
Anonymous
Not applicable
Author

Hi shong,

 

I've been using tftpfile_exist with standard parametres, no variables have been involved.

Here's the screenshot for your reference.

 

Regards,


tftpfile_exists.png
Anonymous
Not applicable
Author

If test is a directory under the home directory, set the Remote directory as "." and directory name as "test".
Anonymous
Not applicable
Author

Hi Shong,

 

Thanks for the quick reply, the nullpointer issue got solve when I replace tFileExist in "if" condition with tFTPfile_Exist but It seems the tFtpfILE_EXIST Component just checks whether the directory exists or not,but in my scenario I have to check whether the list of 20 files exist on that particular directory or not.If count is less than 20 it should trigger the mail. Can you please help me with the arrangement of components required to meet my scenario.

 

 

Thanks in Advance.

 

 

Anonymous
Not applicable
Author

tFTPFileExist check if the specified directory or file exists or not. If you just need to check if the number of files in the particular directory, you can use tFTPFileList, there is a global variables NB_LINE that counts the total number of files found in the directory, you can use this global variable in the runIf expression, eg
((Integer)globalMap.get("tFTPFileList_1_NB_FILE"))<20