Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] detailed Logging statistics

Hi,
I am using tFileList component to iterate and process few thousand files.
I have enabled tstatcatcher .But i need more information than that. (e.g i need file name also)
I made a generic context for it but I'm getting a popup " Can't not apply drag and drop operation on this components currently"

CAN ANYONE HELP ME WITH THIS.
Thanks,
Pankaj
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You can access "pid" using tJava, tJavaRow, tJavaFlex, tMap.......any component where you can use Java.
To deal with a list of files you can use the tFileList component and get the filenames and paths using the related globalMap values. The screenshot below shows the globalMap variables that are available for tFileList.....

0683p000009ME4D.png
You can drag them from the Outline window to any area for a for putting Java code or most strings. They will actually appear something like this when you use them.....

((String)globalMap.get("tFileList_1_CURRENT_FILE"))
The variable above is for the filename for a tFileList component called tFileList_1

View solution in original post

8 Replies
Anonymous
Not applicable
Author

You can't add data to the tStatcatcher schema as such, but you can keep your data elsewhere and link to that particular run using the "pid" Java variable that exists for all Talend Jobs. SO if you store your AMC stats in a database, you could create another table in that database which holds the extra info you want to report on and link the tables using the "pid" value. There are a whole load of variables that you can make use of in a Talend job. Go to your code tab and carry out a "find" for ....

public String pid = "0";

Where you find that you will find a load of public variables you can use to aid in your logging and stats.
Anonymous
Not applicable
Author

Hi rhall,
Thank you for your response.
How can i access pid and i want make list files that are processed successfully and files which are not.
I want their file names and if possible reason why it failed.
Thanks,
Pankaj
Anonymous
Not applicable
Author

You can access "pid" using tJava, tJavaRow, tJavaFlex, tMap.......any component where you can use Java.
To deal with a list of files you can use the tFileList component and get the filenames and paths using the related globalMap values. The screenshot below shows the globalMap variables that are available for tFileList.....

0683p000009ME4D.png
You can drag them from the Outline window to any area for a for putting Java code or most strings. They will actually appear something like this when you use them.....

((String)globalMap.get("tFileList_1_CURRENT_FILE"))
The variable above is for the filename for a tFileList component called tFileList_1
Anonymous
Not applicable
Author

Hi,
Thanks rhall,
Now i can get required details now i am trying to write these errors into a file.(as show in fig.)
i took tstatcatcher component and tried to write in txt file but its giveing me error after inserting 1 record.

Exception in component tFileOutputDelimited_1
java.io.FileNotFoundException: E:\temp.txt (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at demo.ffp_chg_load_dir_0_1.FFP_CHG_LOAD_DIR.tStatCatcher_1Process(FFP_CHG_LOAD_DIR.java:10368)
    at demo.ffp_chg_load_dir_0_1.FFP_CHG_LOAD_DIR$1tFileInputXML_7Thread.run(FFP_CHG_LOAD_DIR.java:3511)
    at routines.system.ThreadPoolWorker.runIt(TalendThreadPool.java:159)
    at routines.system.ThreadPoolWorker.runWork(TalendThreadPool.java:150)
    at routines.system.ThreadPoolWorker.access$0(TalendThreadPool.java:145)
    at routines.system.ThreadPoolWorker$1.run(TalendThreadPool.java:122)
    at java.lang.Thread.run(Unknown Source)
disconnected

I have give all the permissions to all users.
can u tell why its not working.
0683p000009MDzd.png
Anonymous
Not applicable
Author

It is claiming that access is denied to the file. Check the filesystem and the file to ensure that you have write access. A thing to try is to run Talend as an Administrator. This is sometimes an easy way to solve this issue.
Anonymous
Not applicable
Author

Hi now m getting errors like
Exception in component tFileOutputExcel_1
java.lang.ArrayIndexOutOfBoundsException: 33522176
    at jxl.read.biff.CompoundFile.readSmallBlockDepot(CompoundFile.java:246)
    at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:187)
    at jxl.read.biff.File.<init>(File.java:127)
    at jxl.Workbook.getWorkbook(Workbook.java:221)
    at demo.test_0_1.test.tStatCatcher_2Process(test.java:1831)
    at demo.test_0_1.test.runJobInTOS(test.java:6903)
    at demo.test_0_1.test.main(test.java:6755)

and
illegal state exception


0683p000009MPcz.png
Thanks,
Pankaj
Anonymous
Not applicable
Author

Where are you using an Excel file? This error is to do with your  tFileOutputExcel_1 component.
It is likely due to the fact that the Excel schema is not configured correctly, but I cannot tell from that message.
Anonymous
Not applicable
Author

Hi ,
I used tLogRow component before writting in file and  that worked.
Thanks for your help.

Regards,
Pankaj