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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
tanjaj
Contributor III
Contributor III

How to handle null exception in tAdvancedFileOutputXml component

Hi,

Talend job iterates through site names in excel file, compares it with data in DB and generates XML files with orders details. For one code, there are no orders, but it throws me an error and kills the job. In case of Order id doesn't exist I want to generate an empty file or to handle it on some other way, but definitely not to fail the job.

I tried with checking "Create attribute even if its value is NULL" but i have the same result.

I'm sending screenshots of my job and tAdvancedFileOutputXML component configuration.

Error trace:

Exception in component tAdvancedFileOutputXML_2 (Child_export_job)

java.lang.NullPointerException

   at expot_xml_data.child_export_job_1_0.Child_export_job.tDBInput_5Process(Child_export_job.java:1385)

   at expot_xml_data.child_export_job_1_0.Child_export_job.tDBInput_4Process(Child_export_job.java:967)

   at expot_xml_data.child_export_job_1_0.Child_export_job.runJobInTOS(Child_export_job.java:4405)

   at expot_xml_data.child_export_job_1_0.Child_export_job.runJob(Child_export_job.java:4224)

   at expot_xml_data.export_data_xml_1_0.export_data_xml.tFileList_1Process(export_data_xml.java:1679)

   at expot_xml_data.export_data_xml_1_0.export_data_xml.runJobInTOS(export_data_xml.java:3659)

   at expot_xml_data.export_data_xml_1_0.export_data_xml.main(export_data_xml.java:3486)

Exception in component tRunJob_1 (export_data_xml)

java.lang.RuntimeException: Child job running failed.

java.lang.NullPointerException: null

   at expot_xml_data.export_data_xml_1_0.export_data_xml.tFileList_1Process(export_data_xml.java:1700)

   at expot_xml_data.export_data_xml_1_0.export_data_xml.runJobInTOS(export_data_xml.java:3659)

   at expot_xml_data.export_data_xml_1_0.export_data_xml.main(export_data_xml.java:3486)

Labels (5)
1 Solution

Accepted Solutions
tanjaj
Contributor III
Contributor III
Author

I got it.

I just added one IF in component tJavaRow ("Dates as global var" from screenshot), like this:

 

 

if(input_row.min_Date != null && input_row.max_Date != null){

 

context.min_Date = input_row.min_Date;

 

context.max_Date = input_row.max_Date;

}

 

And in tAdvancedFileOutXml component I checked Don't generate empty file.

S, for the missing orders it just didn't generate files.

 

@Manohar B​ Thank you fr the reply.

 

 

 

View solution in original post

2 Replies
manodwhb
Champion II
Champion II

@Tanja Jovovic​ ,check the below case .

https://www.talendforge.org/forum/viewtopic.php?pid=204410

 

tanjaj
Contributor III
Contributor III
Author

I got it.

I just added one IF in component tJavaRow ("Dates as global var" from screenshot), like this:

 

 

if(input_row.min_Date != null && input_row.max_Date != null){

 

context.min_Date = input_row.min_Date;

 

context.max_Date = input_row.max_Date;

}

 

And in tAdvancedFileOutXml component I checked Don't generate empty file.

S, for the missing orders it just didn't generate files.

 

@Manohar B​ Thank you fr the reply.