You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2008-05-27 16:54:53

ben23
Member
7 posts

ben23 said:

Tmap null pointer exception

Tags: [error, java, lookup, loop, null, tmap]

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
mini_12016_job.JPG

Offline

#2 2008-05-28 07:07:28

shong
Talend Team


shong said:

Re: Tmap null pointer exception

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 http://www.talendforge.org/forum/viewtopic.php?id=2927

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

#3 2008-05-28 09:29:27

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

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

Offline

#4 2008-05-29 08:27:24

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

Hi,

Any idea for this problem ?

Thanks for reply,

Ben23

Offline

#5 2008-05-29 09:12:18

amaumont
Talend Team


amaumont said:

Re: Tmap null pointer exception

Can you show us metadata of your tMap input tables ?

Offline

#6 2008-05-29 09:57:47

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

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
[img]http://www.talendforge.org/forum/img/members/1602/mini_12109_Sans titre.JPG[/img]mini_12109_mapping.JPGmini_12109_result.JPG

Offline

#7 2008-05-29 10:29:28

shong
Talend Team


shong said:

Re: Tmap null pointer exception

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


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

#8 2008-05-29 10:51:19

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

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

Offline

#9 2008-05-29 11:57:27

amaumont
Talend Team


amaumont said:

Re: Tmap null pointer exception

Your error come from an interaction problem between Iterate connection and free memory of lookups.

You can follow the [Bug] 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:
            [Component with Iterate] ---Iterate---> tRunJob(call of job2)
   
    Job2:
            [Input] -----------------> tMap -> Output
            [input] --Lookup----->

Last edited by amaumont (2008-05-29 12:56:04)

Offline

#10 2008-05-29 14:29:17

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

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

Offline

#11 2008-05-29 14:43:56

amaumont
Talend Team


amaumont said:

Re: Tmap null pointer exception

Sorry, we can't share variables between jobs for the moment, it will possible a day but I don't know when.

You can wait for the 2.4 RC4 or modify the templates like described above.

amaumont

Offline

#12 2008-05-29 14:46:30

ben23
Member
7 posts

ben23 said:

Re: Tmap null pointer exception

Ok thanks for your answer.

Regards,

ben23

Offline

#13 2010-07-12 15:24:47

TomasAlmeida
Member
22 posts

TomasAlmeida said:

Re: Tmap null pointer exception

I have the same problem on Talend 4.0.2, but when I tried to execute the 1st workaround, I saw that the code was already removed in the files.

Offline

#14 2012-02-01 05:17:34

Sruthi
Guest

Sruthi said:

Re: Tmap null pointer exception

Hi Everyone,

                In my job.in tMap Component am getting null Pointer Exception Error.the error which am getting in my job is :

Exception in component tMap_1
java.lang.NullPointerException
    at demo.bagmakers_new_0_1.BagMakers_New.tFileInputExcel_1Process(BagMakers_New.java:13692)
    at demo.bagmakers_new_0_1.BagMakers_New.runJobInTOS(BagMakers_New.java:16145)
    at demo.bagmakers_new_0_1.BagMakers_New.main(BagMakers_New.java:16016)
[statistics] disconnected
Job BagMakers_New ended at 09:34 01/02/2012. [exit code=1]

  Can anyone help me out in resolving this error its urgent...

Thanks in Advance,
Sruthi

#15 2012-02-01 05:22:00

pedro
Member
3682 posts

pedro said:

Re: Tmap null pointer exception

Hi Sruthi

You'd better upload screenshots of tMap.
Then we can figure out and fix it.

Regards,
Pedro


Only Paranoid Survive.

Offline

#16 2012-04-12 04:02:40

martha.author
Member
1 post

martha.author said:

Re: Tmap null pointer exception

I have the exactly the same problem and when I executed the workaround the line of code was removed in the files. This post has been a great help.


RFID

Offline

#17 2013-11-20 14:38:23

keyur
Member
26 posts

keyur said:

Re: Tmap null pointer exception

Sorry to restart the thread.

But I am getting the same error in Talend 5.3.
Checked the component java file, but I dont find anything to be commented on line 91 and 111.

Please help me to resolve this. This has happened suddenly. I didn't face this issue earlier.

Keyur

Offline

#18 2013-11-20 15:22:20

janhess
Member
1315 posts

janhess said:

Re: Tmap null pointer exception

We need more info such as map rule. You are probably doing some java processing on a null value in your map rule.

Offline

#19 2013-11-21 09:47:53

keyur
Member
26 posts

keyur said:

Re: Tmap null pointer exception

Thanks for the reply.
It is indeed the case. I have rectified it.

Offline

#20 2014-09-23 12:12:53

chidozie
Member
2 posts

chidozie said:

Re: Tmap null pointer exception

Hey,
I am having the same problem too, how do i solve this error ,
even due the records are saved to the database successfully i just dont like seeing this error and i not sure if it might make the job fail in future .

 
Thanks
chidozie

Offline

#21 2014-09-23 21:09:08

jlolling
Member
3186 posts

jlolling said:

Re: Tmap null pointer exception

You mean you get some NullPointerExceptions ?
There are plenty reasons for getting this. One of the most common reason is to have a tMap with an input flow with numeric nullable columns mapped to numeric NONE nullable columns. Because of the automatic unboxing in Java this could fail if the input value is null.
Please provide a bit more information as "Yes I have the same problem" because I guess you will not habe the same job running like in the original post.


Talend Certified working for cimt objects AG in Berlin

Offline

#22 2014-09-24 08:42:29

chidozie
Member
2 posts

chidozie said:

Re: Tmap null pointer exception

@jlolling thanks for your reply

actually i have a job which picks form a flat file (text file ) and loads into oracle database , when i run the job i normally get these  NullPointerExceptions error   , but if i check the table the record was been loaded successfully .
i am worried that because of these error, the job might fail in the near future 


thanks

Offline

#23 2014-09-25 09:27:31

shong
Talend Team


shong said:

Re: Tmap null pointer exception

chidozie wrote:

@jlolling thanks for your reply

actually i have a job which picks form a flat file (text file ) and loads into oracle database , when i run the job i normally get these  NullPointerExceptions error   , but if i check the table the record was been loaded successfully .
i am worried that because of these error, the job might fail in the near future 


thanks

The job will stop if the 'die on error' option is checked on tMap, otherwise, the job will continue to process next record even thought this error occurs, but not all of the records are loaded into database. Anyway, you are necessary to analyse the error and resolve it before you deploy the job to product environment. 

Best regards
Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

#24 2016-02-02 12:07:01

bipinkumarcse
Member
4 posts

bipinkumarcse said:

Re: Tmap null pointer exception

how can we find at specifically which column and what data inside that is throwing this null pointer exception as i am puzzled and my source has 2 million records and we are populating target by joining  multiple tables. and also how to filter out erroneous data from tmap into any file or any table so that we can modify the data if required

Last edited by bipinkumarcse (2016-02-02 12:10:37)

Offline

#25 2016-02-02 22:31:12

jlolling
Member
3186 posts

jlolling said:

Re: Tmap null pointer exception

Simply check which input column is nullable and is assigned to a none-nullable output column. These are potential assignments causing a NullPointerException.


Talend Certified working for cimt objects AG in Berlin

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy