One Star

Exception in component tMap_1 java.lang.NullPointerException

So let me preface this post by mentioning that I have searched the community high and low on how to best debug NullPointerExceptions in a talend mapping component.  I've taken over maintenance on a two talend ETL integrations between SQL views and salesforce.com, and suddenly on Jan 20th they both started failing due to null pointer exceptions.  Both jobs use a mapping component called tMap_1

 

One is integrating salesforce account objects

The other is integrating a salesforce custom object representing invoices

 

The tmap_1 leverages a left outer join to join ownerids from salesforce, for both the account objects and invoice objects the join assigns a salesforce ownerid based on a matching field the SQL db/ERP uses.  The rows for the join are correctly attained, the rows from SQL are correctly attained, no issues getting the data.

 

The mapping that maps the data then gets an error, nullpointer exception.

I change the SQL query to return only 1 row, to see if there is still an error -there is

The SQL query returns no null data when run

The field the single row joins on is there, and see no reason why the join would fail

I made sure there was nothing flagged as nullable on the left/input side of the map that wasn't nullable on the right/output side

The exception data has a few different stack traces.  The job fails because a subjob failed.  The subjob that fails is the one with the mapping.

 

Here is the full stack trace:

Starting job WPAccountToSF at 19:21 05/02/2018.


[statistics] connecting to socket on port 3740
[statistics] connected

-----------------------------------------------------
job WPAccountToSF started.....
-----------------------------------------------------


Setting required environmental parameters....
-----------------------------------------------------

The batch job is located at : C:/Program Files/salesforce.com/Data Loader/cliq_process/WPAccountToSF/

Integration started at : 2018-02-06T00:21:58Z

The CSV File is located at : C:/Program Files/salesforce.com/Data Loader/cliq_process/WPAccountToSF/read/

the name of the csv file is : WPAccountToSF.csv

------------------------------------------------------------------
tContextLoad_1 set key "ILRT" with value "2018-02-04 18:05:00.000"
The system cannot find the path specified.

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>SET DLPATH="C:\Program Files\salesforce.com\Data Loader"

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>SET DLCONF="C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID\config"

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>SET DLDATA="C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID\write"

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>call "C:\Program Files (x86)\Java\jre1.8.0_111\bin\java.exe" -cp "C:\Program Files\salesforce.com\Data Loader"\* -Dsalesforce.config.dir="C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID\config" com.salesforce.dataloader.process.ProcessRunner process.name=WPAccountToSF_SFID

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>REM To rotate your export files, uncomment the line below

C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID>REM copy "C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID\write"\WPAccountToSF_SFID.csv "C:\Program Files\salesforce.com\Data Loader\cliq_process\WPAccountToSF_SFID\write"\20180502-19-WPAccountToSF_SFID.csv

 

 

The main job name is :WPAccountToSF_SFID
The Start Time Was: 2018-02-06T00:21:58Z
The Cliq job location is :C:/Program Files/salesforce.com/Data Loader/cliq_process/WPAccountToSF_SFID/
Total rows are : 1
Error Attachment Location is :C:/Program Files/salesforce.com/Data Loader/cliq_process/Insert_Error_Attachment/
Exception in component tMap_1
java.lang.NullPointerException
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.tRowGenerator_2Process(TalendStatusLog_v1.java:3179)
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.tFileList_2Process(TalendStatusLog_v1.java:1745)
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.tFileList_1Process(TalendStatusLog_v1.java:1262)
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.tJava_1Process(TalendStatusLog_v1.java:790)
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.runJobInTOS(TalendStatusLog_v1.java:6210)
at ucs_project.talendstatuslog_v1_0_1.TalendStatusLog_v1.runJob(TalendStatusLog_v1.java:5999)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tRunJob_3Process(WPAccountToSF.java:12985)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tSystem_2Process(WPAccountToSF.java:12749)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tFileList_1Process(WPAccountToSF.java:12414)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tMSSqlInput_1Process(WPAccountToSF.java:10110)
2018-02-05 19:23:08|NS1sI5|LuR1vI|LuR1vI|UCS_PROJECT|TalendStatusLog_v1|Default|6|Java Exception|tMap_1|java.lang.NullPointerException:null|1
Error Encountered
WPAccountToSF
2018-02-06T00:21:58Z
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tSalesforceInput_2Process(WPAccountToSF.java:4229)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tJava_1Process(WPAccountToSF.java:3245)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.runJobInTOS(WPAccountToSF.java:16527)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.main(WPAccountToSF.java:16289)
Exception in component tRunJob_3
java.lang.RuntimeException: Child job running failed
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tRunJob_3Process(WPAccountToSF.java:13007)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tSystem_2Process(WPAccountToSF.java:12749)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tFileList_1Process(WPAccountToSF.java:12414)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tMSSqlInput_1Process(WPAccountToSF.java:10110)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tSalesforceInput_2Process(WPAccountToSF.java:4229)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.tJava_1Process(WPAccountToSF.java:3245)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.runJobInTOS(WPAccountToSF.java:16527)
at ucs_project.wpaccounttosf_0_1.WPAccountToSF.main(WPAccountToSF.java:16289)
2018-02-05 19:23:09|LuR1vI|LuR1vI|LuR1vI|UCS_PROJECT|WPAccountToSF|Default|6|Java Exception|tRunJob_3|java.lang.RuntimeException:Child job running failed|1
[statistics] disconnected
Job WPAccountToSF ended at 19:23 05/02/2018. [exit code=1]

 

 

Is there a trick to setting a breakpoint in the correct place?  Any other tips & tricks for pinpointing the null pointer?  I am not sure if I am reading the stack trace correctly and the issue is in the tmap.  I'm not sure how a tmap could work fine, then one day start throwing a null pointer exception unless there was an issue with the data, which doesn't seem to be the case.  The mapping is not calling any java functions I can see that would even cause a null pointer error.  Is it possible the error is not in the tmap but elsewhere?  Thank you so much for any help and guidance the community can provide here.

 

3 REPLIES
Eleven Stars

Re: Exception in component tMap_1 java.lang.NullPointerException

Where ever you have created expersions in tMap there any one of those column is getting null values,you need to handle nulls first and the add into expresion.
Manohar B
Thirteen Stars TRF
Thirteen Stars

Re: Exception in component tMap_1 java.lang.NullPointerException

Seven Stars

Re: Exception in component tMap_1 java.lang.NullPointerException

For null pointer errors, I go to the line of Java code that generated the error to see what object is showing up as null. From the stack trace, it's row 3179.

Also, did you see the path error at the start of your stack trace? If your job passes a reference to that file to tMap (or another component), it can cause this type of exception if the file isn't there.