One Star

Exception in component tMap java.lang.NullPointerException

Hello,
I have a very simple job with one Excel spreadsheet as an input file, a tmap component and another Excel spreadsheet as an output file. I have been to many posts and tried a lot of solutions but nothing works. What is strange is that I have no null value in my spreadsheet.
This is the complete error message:

"Exception in component tMap_2
java.lang.NullPointerException
at leave_calendar.xero_integration_with_salesfoce_0_1.Xero_integration_with_Salesfoce.tFileInputExcel_3Process(Xero_integration_with_Salesfoce.java:1286)
at leave_calendar.xero_integration_with_salesfoce_0_1.Xero_integration_with_Salesfoce.runJobInTOS(Xero_integration_with_Salesfoce.java:1677)
at leave_calendar.xero_integration_with_salesfoce_0_1.Xero_integration_with_Salesfoce.main(Xero_integration_with_Salesfoce.java:1558)"


I have attached a capture of my tmap.

                                                






This is an extract of my Excel spreadsheet:
 























EmployeeEmployee GroupLeave StatusLeave TypeStart DateEnd Date
Carissa  PerdulovskiQLDScheduledPersonal/Carer's Leave4/08/20154/08/2015
Carol ArnoldQLDRejectedAnnual Leave21/08/201521/08/2015
Charline MitchenerQLDApprovedAnnual Leave16/08/201520/08/2015
  
Any help will be very much appreciated. Thank you in advance.
Sylvie
12 REPLIES
Moderator

Re: Exception in component tMap java.lang.NullPointerException

Hi ultima67,
Could you please upload your screenshot of tMap editor into forum which will be helpful for us to address your issue quickly?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Exception in component tMap java.lang.NullPointerException

Sorry,
I thought when the image was uploaded it will be attached automatically to the message.
Here it is:
   
Thank you
Sylvie
                                             
Moderator

Re: Exception in component tMap java.lang.NullPointerException

Hi,
This issue is probably caused by  a null value.
Could you please firstly check row1.Leave_Status != null
after then using your Condition?value if true: value if false method?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Exception in component tMap java.lang.NullPointerException

Hi,
Same error message "NullPointerExeption" after adding the expression"
"row1.Leave_Status !=null?"":row1.Leave_Status" in the column Leave_Status on theLeaveRequestOut component.
Best regards,
Sylvie
Moderator

Re: Exception in component tMap java.lang.NullPointerException

Hi,

Please try this solution

 
row1.Leave_Status !=null || row1.Leave_Status.equals("")? value if true: value if false method.
 
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Exception in component tMap java.lang.NullPointerException

Hi Sabrina,
I have amended my expression :
"row1.Leave_Status!=null||row1.Leave_Status.equals("")?"":row1.Leave_Status"
Still get same error message.
Thanks
Sylvie
One Star

Re: Exception in component tMap java.lang.NullPointerException

Hi,
once try this solution.
Click on excel component and goto Advanced Settings and Check the  Stop to Read on Empty Rows button .
and run the job .
One Star

Re: Exception in component tMap java.lang.NullPointerException

Thank you so much, it works.
One Star

Re: Exception in component tMap java.lang.NullPointerException

Hello,
Everything worked fine last week, and when I ran the job again this morning I got again the same error message. It is strange because I didn't change anything. Any idea? Thank you.
Moderator

Re: Exception in component tMap java.lang.NullPointerException

Hi,
Did you change your input excel file? Have you tried to check out "Trim" option in Advanced Settings of tfileinputexcel to trim the leading and trailing white space?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Exception in component tMap java.lang.NullPointerException

Hi,
Yes, the input file is new every week. It is a report generated by another software. Only the data change not the structure, it is always the same report. I have re-run the report and it works again. Very strange.... I will try to check out "Trim" option as recommended.
Thank you for your help.
Best regards,
Sylvie
Fifteen Stars

Re: Exception in component tMap java.lang.NullPointerException

Here is a good way of solving this issue (http://www.rilhia.com/node/45). Talend actually provides a hidden mechanism in the tMap to reveal the row that has caused an issue like this. From that you can quite quickly solve this.
Rilhia Solutions