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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] [OutputFileComponent] Error occurs when rows is null

Hello. For my process, my mapping component return no rows. This case can be happen with our datas.
How can i stop the process to don't have this error, ingore this error, or better, can i define settings for the tAdvanceFileOutputXML to not trying to generate a file with null or no rows input.  
I set only to true for my component the settings :
[list=*]

  • Do not generate empty file

 

  • Create directory if does not exist



Exception in component tAdvancedFileOutputXML_1
java.lang.NullPointerException


https://www.talendforge.org/forum/img/members/316269/blob_20150909-1108.png

https://www.talendforge.org/forum/img/members/316269/blob_20150909-1112.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
Take a look at this article to learn how to active these technical components (tHashInput and tHashOutput). tJavaFlex should be available by default, I don't understand why you can't find it.

Best regards
Shong

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi
You can check the number of rows before writing the data to file. For example
....main--tHashOutput-main-tJavaFlex
  |
onsubjobok
  |
tJava--runIf--tHashInput--main--tAdvancedFileOutputXML
in the begin part of tJavaFlex, define a counter with int type.
int counter=0;
in the main part:
counter=counter+1;
in the end part, store the counter to a global variable
globalMap.put("counter",counter);

on tJava, get the row number and check if greater than 0.
int counter= (Integer)globalMap.get("counter");
if(counter>0){
globalMap.put("hasData",true);
}else{
globalMap.put("hasData",false);
}
Set the condition of runIf link as:
(Boolean)globalMap.get("hasData")

Best regards
Shong
Anonymous
Not applicable
Author

I work with TOS for ESB 6.1.0.20150815_15_15-M1.
I have not these component tHashInput, tHashOutput and tJavaFlex :s
I try too to attach the tJava-RunIf on many component, but he don't want. On which component can i link the RunIf ?
Anonymous
Not applicable
Author

Hi
Take a look at this article to learn how to active these technical components (tHashInput and tHashOutput). tJavaFlex should be available by default, I don't understand why you can't find it.

Best regards
Shong
Anonymous
Not applicable
Author

Oups, i have the tJavaFlex but it does not appear when i write his name. I must take it from tools.
For next, all work fine.

Thanks for the help.
In our project, not only developpers will used Talend. If i can give a suggestion, it will be great if Talend improve a component for counting number of row to avoid us writing java code.