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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RAJ6
Contributor III
Contributor III

java.lang.NullPointerException Error

Hi Talend folks,

             

               When I write below expression for particular column. I am Facing "NullPointerException".

How to solve this issues. please tell me?

 

(row8.Sales.equals("o") && row9.Bun.equals("B"))?
"B" : (row8.Sales).equals("o")?
"D" : (row8.Sales.equals("o") && row9.Bun.equals("B"))?
"B": row8.Sales

 

0683p000009LvZt.png

 

ERROR:

Exception in component tMap_3 (LM)
java.lang.NullPointerException
at local_project___java.lm_0_1.LM.tFileInputExcel_2Process(LM.java:19165)
at local_project___java.lm_0_1.LM.runJobInTOS(LM.java:21300)
at local_project___java.lm_0_1.LM.main(LM.java:21126)
[FATAL]: local_project___java.lm_0_1.LM - tMap_3 null

Labels (4)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

add check null

 

(row8.Sales!=null&&row9.Bun!=null)&&(row8.Sales.equals("o") && row9.Bun.equals("B"))?

You need add check null for all important columns

 

for example - first check - if any of columns null - than null
other variant - define default value for replace null

View solution in original post

8 Replies
vapukov
Master II
Master II

add check null

 

(row8.Sales!=null&&row9.Bun!=null)&&(row8.Sales.equals("o") && row9.Bun.equals("B"))?

You need add check null for all important columns

 

for example - first check - if any of columns null - than null
other variant - define default value for replace null

RAJ6
Contributor III
Contributor III
Author

Thank you @vapukov

pradeephc0671
Contributor
Contributor

Hello,

I am experiencing a similar issue when using the sql editor. Do you mind giving more specific details on what you mean by "other variant - define default value for replace null"?

Thanks so much!

kyawzin
Contributor II
Contributor II

Dear team,

I have the problem of NullPointerException Error but cause is little different. Please help me on the case.

Let say, I got csv file from other team with 10 columns, comma separated value. But one row has only 3 column's value.

While I load data in tmap, i got the error even though I put isempty or null function in tmap. Please see the image for detail and I saw no comma in one row, when error is start happening.


Capture.PNG
Anonymous
Not applicable

Hello @kyawzin 

Do your your input columns have null value? Could you please show us your tMap setting screenshot on community?

Best regards

Sabrina

 

kyawzin
Contributor II
Contributor II

Yes of course @xdshi , please see the picture in the attachment.

I have noticed one thing but no idea. You can see in my previous picture, there is no comma in the middle row. Actually there must be comma even though there is no value for the rest of the columns. The error is start happening before that row.


Capture2.PNG
kyawzin
Contributor II
Contributor II

0683p000009M5ec.png

@xdshi  you can see my output result, some of the row are imported but start from the row which has only two value for 6 columns without comma for the rest column. Example see the line 711400.

0683p000009M5c8.png

kyawzin
Contributor II
Contributor II

@xdshi , hi any comment?