Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ATernovenko
Contributor III
Contributor III

Error java.lang.NullPointerException, when tLogRow has value not null

Hello, Im new in Talend and I have some error.

TOS 7.3

I have Job exceloader8 which takes data from the excel file and loads into Oracle

table,

then archives and removes excel file from directory. Command to delete a file comes from tRunJob_2 as a variable ReturnCode

If "0" then tFileArchive,

If "1" then tFileCopy.

I get the value "0" from tRunJob_2 (tLogRow_2), but tJavaFlex_1 gives an error

Error message:

"

Exception in component tJavaFlex_1 (exceloader8)

java.lang.NullPointerException

at investigation_new.exceloader8_0_1.exceloader8.tFileList_1Process(exceloader8.java:1272)

at investigation_new.exceloader8_0_1.exceloader8.runJobInTOS(exceloader8.java:2257)

at investigation_new.exceloader8_0_1.exceloader8.main(exceloader8.java:2081)

"

My

tJavaFlex_1 is empty, fnd If(order:1) and If(order:2) have next code:

If(order:1)

((Integer)globalMap.get("row3.ReturnCode")) != 0 If(order:2)

((Integer)globalMap.get("row3.ReturnCode")) == 0I cannot understand why I am getting

NullPointerException

errorI would be grateful for your help

Labels (3)
4 Replies
ATernovenko
Contributor III
Contributor III
Author

my screenshots:

 

0695b00000LyqWhAAJ.jpg0695b00000LyqWcAAJ.jpg

Anonymous
Not applicable

Hi

I think the problem comes from (Integer)globalMap.get("row3.ReturnCode"), this expression return null value. If ReturnCode is the schema column returned from tRunJob_2, you can change the job design as below:

...tRunJob_2--main--tJavaRow--runif1--tFileCopy

--runIf2--tFileArchive

on tJavaRow:

if(input_row.ReturnCode==0){

globalMap.put("doArchive",true);

globalMap.put("doCopy",false);

}else{

globalMap.put("doArchive",false);

globalMap.put("doCopy",true);

}

 

set the condition of runIf1:

(boolean)globalMap.get("doCopy")

 

set the condition of runIf2:

(boolean)globalMap.get("doArchive")

 

Regards

Shong

 

 

 

ATernovenko
Contributor III
Contributor III
Author

Shong, thanks for advice!

I tried to do what you advised, but nothing came of it. The error is repeated. Error in tJavaRow block.

I think the problem is in the tRunJob_2 object.

Anonymous
Not applicable

the error occurs on tJavaFlex component. For debugging, deactivate the runIf link and tFilexxx Components and run again to see if the problem still exists.