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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Jj5
Contributor III
Contributor III

[resolved] NullPointerException (possible bug) in tMap [Need Help With a Filter]

I discovered what the actual problem was and posted a screen shot. See my last post for details. I'd be happy to host a WebEx session if anyone is interested enough in that.





I have a job that combines 3 delimited input files into a single delimited output file. The program runs perfectly, no errors.
However I have to change one of my delimited input files (the main) to a different excel input file. I mapped it correctly, all the fields are nullable. When I run the job I get the following error:
Exception in component tMap_1
java.lang.NullPointerException
at testproject.pimco_0_2.PIMCO.tFileInputDelimited_2Process(PIMCO.java:24714)
at testproject.pimco_0_2.PIMCO.runJobInTOS(PIMCO.java:27633)
at testproject.pimco_0_2.PIMCO.main(PIMCO.java:27498)
I tried a new job where I have only the new excel file and I copied the tMap. When I run that job, it works fine. The nullpointer error only happens when I try to combine the new file with the two other delimited input lookup files.
I tried making different files the main file and the problem is always with the main, never the lookup files.
I forgot to mention that the excel file has no null values. I tried changing every cell to the same string value and I still got the same error. I also used Talend to convert the file from excel to a CSV so it would be the same filetype as the other two. Talend still gave me a null pointer error when I tried combining the three files, but when I only use the new file I get no error.
This is pretty urgent so any suggestions would be greatly appreciated.
Thanks a ton in advanced,
JJ Potgieter.
Labels (4)
26 Replies
Jj5
Contributor III
Contributor III
Author

I'm still getting the nullpointerexception. I've uploaded screenshots of the error that I'm getting, then a screenshot of the code at the line from the error message, then the field that gave me the code. Oh and I had to change the connection from Collateral to Loan, sorry if that caused any confusion.
0683p000009MDCx.jpg 0683p000009MDSA.jpg 0683p000009MDSJ.jpg
janhess
Creator II
Creator II

It's because you're doing the replace before checking for null (I think). So you need to do the isnull and then replace if false.
Jj5
Contributor III
Contributor III
Author

It's because you're doing the replace before checking for null (I think). So you need to do the isnull and then replace if false.

WOW! Never in a million years would I have suspected that this was the problem. It is now working as intended, thank you so much!
If you're even in the Atlanta area I'll have to to buy you a lunch 0683p000009MA9p.png
Anonymous
Not applicable

Hi,
I have a situation, I have source table and from that i am spliting data into 2 table on the basis of some validation on columns.
validation :  Suppose i have Name column and its length is 10 but in some cases i found that Name column has values more than the length(10) . so in this case i want to split data in to 2 tables .
if values are greater than length then it goes to ERROR table and value is equal or less than length then it goes to proper Target table.
&
I have done with given situation with this logic row1.TRINAMETX.length()>10 
But,
I am getting error....
Starting job Job_Geography_triCountry_Part_1 at 15:03 11/09/2015.
connecting to socket on port 4008
connected
Exception in component tMap_1
java.lang.NullPointerException
at demo.job_geography_tricountry_part_1_0_1.Job_Geography_triCountry_Part_1.tFileInputExcel_1Process(Job_Geography_triCountry_Part_1.java:3648)
at demo.job_geography_tricountry_part_1_0_1.Job_Geography_triCountry_Part_1.runJobInTOS(Job_Geography_triCountry_Part_1.java:6206)
at demo.job_geography_tricountry_part_1_0_1.Job_Geography_triCountry_Part_1.main(Job_Geography_triCountry_Part_1.java:6065)
disconnected
Job Job_Geography_triCountry_Part_1 ended at 15:03 11/09/2015.

Waiting for the Reply?
Thanks in Advance.
Regards,
Shriram
Talend User.
Anonymous
Not applicable

no one replied to my post....feeling very bad  0683p000009MPcz.png
Anonymous
Not applicable

Hi Shri_kul1
Sorry for the delay reply. About the NPE, there exists null value in the  TRINAMETX column, you need to check the NULL value, filter the null value or transform it to other value, for example, replace null value with empty string:
row1. TRINAMETX==null? "":row1. TRINAMETX
before you handle it with the logic  row1.TRINAMETX.length()>10.

Best regards
Shong
Anonymous
Not applicable

hi,
as you said , same situation : you 've to manage null value
you try row1.TRINAMETX.length when row1.TRINAMETX is null
=> java try to manage null.length() ... but it couldn't.
so in your code do something like :

row1.TRINAMETX != null ?
row1.TRINAMETX.length()>10 :
/* your code here when row1.TRINAMETX is null */


regards
laurent
Ps : didn't seen Shong's answer (on page 2  ... 0683p000009MACn.png )
apologize @Shong 0683p000009MA9p.png