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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Tmap null pointer exception

Hello,
I'm using Java TOS 2.4.0.RC1.
I'm using a tWaitForFile to start a mixing a xml File and doing a lookup on DB2 AS400 table.
During the first iteration i have no problem all succeed but the second iteration make a nullpointerException in Tmap.

Exception in component tMap_1
java.lang.NullPointerException
at rfid.rfid_0_1.rfid.tWaitForFile_1Process(rfid.java:2051)
at rfid.rfid_0_1.rfid.tAS400Connection_1Process(rfid.java:261)
at rfid.rfid_0_1.rfid.runJobInTOS(rfid.java:3940)
at rfid.rfid_0_1.rfid.main(rfid.java:3852)
It's seem due to lookup component but i' don't understand why.

Thanks for reply

Labels (4)
32 Replies
Anonymous
Not applicable
Author

Hello ben23
Exception in component tMap_1
java.lang.NullPointerException

1) Make sure your columns are nullable when you define the schema.
2) The NullPointerException indicate there are some null value on lookup table, so you need to deal with the null value on corresponding columns on expression filed of tmap, for example:
row1.name==null?value1:row1.name
3) please read the related 2927
Best regards
shong
Anonymous
Not applicable
Author

Hi,
Thanks for your reply.
Normally my values cannot be null because the second iteration was maked with the same file and the same value in the lookup table.
It's seem due to lookup table during the loop, because the table was loaded only once.
How can we load the lookup table at each iteration ?
Thanks for reply
ben23
Anonymous
Not applicable
Author

Hi,
Any idea for this problem ?
Thanks for reply,
Ben23
amaumont
Contributor III
Contributor III

Can you show us metadata of your tMap input tables ?
Anonymous
Not applicable
Author

Hi,
You can find in upload image my configuration for tmap and TWaitForFile component. And the result of the job with the same data xml file and same data table for two iterations.
Thanks for reply,
ben23
Anonymous
Not applicable
Author

Hello ben23
I have reproduced your job and checked that it should be a bug on tMap. Can you report a bug on our bugtracker with detailed information?
Thanks for your support!
Best regards

shong
Anonymous
Not applicable
Author

Hi shong,
Sorry what do you want exactly ?
Should i make a report on this page http://www.talendforge.org/bugs/my_view_page.php ?
And in this case what i should post ?
Thanks for reply,
Ben23
amaumont
Contributor III
Contributor III

Your error come from an interaction problem between Iterate connection and free memory of lookups.
You can follow the 3966 which describe which modifications could be done from 2.4 RC3 before a definitive solution for 2.5.0.
We are being to find a definitive solution to this problem, in fact we have two choices for the moment:
- empty always lookups data from memory, which implies your error
- does not empty lookups data from memory, which implies that lookups data are accumulated in the different lookups of job
Two workarounds exist:
- comments all free memory/files calls into tMap_end.javajet template
> edit TOS-All-r14257-V2.4.0RC2/plugins/org.talend.designer.components.localprovider_2.4.0.RC2_r14257/components/tMap_end.inc.javajet
> comment lines 91, 111, 115 to keep data in memory and temporary files for next iterations
> tMap_end.javajet have to be modified also, add simply a space and save it to be recompiled
- design your job like :
Job1:
---Iterate---> tRunJob(call of job2)

Job2:
-----------------> tMap -> Output
--Lookup----->
Anonymous
Not applicable
Author

Hi amaumont,
Thanks for your reply.
I try your solution to call my job with a tRunJob and it's worked. But with this solution I haven't a permanent connection, and it's a problem because my job must be in real time.
It's possible to share connection between two jobs ?
Regards,
ben23