
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In tMap, my variable can't be null : java.lang.NullPointerException error
Hello,
I need to create a variable in the middle part of a tMap component.
This variable should be a byte type variable.
It is calculated by testing a char type input data (through a global routine) :
If CharData = 'A' Then 1
Else if CharData = 'B' Then 0
Else null
The problem is that I have the following message error : java.lang.NullPointerException
I think that it is due to the fact that the variable is null because the char data is blank.
Does it mean that a variable can't be null ?!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your screenshot, var1 is not set as "nullable". Make sure that in tMap you have checked the 'nullable' checkbox , which is near the name of your variable (unchecked by default)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It depends how you have configured the variable. If the variable is also not null configured that you will get this Exception.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could you please post your tMap component setting screenshots here which will be helpful for us to address your issue?
Best regards
Sabrina

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Here is the job I use to test.
This is working :
But I need to calculate QCDemandeNu in the middle part of the tMap, because I'll use it to calculate other variables.
So this the tMap I would like to use :
The problem is that I can't use the type Byte (which allows null values) in the variable part, whereas I can in the output part of the tMap.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your screenshot, var1 is not set as "nullable". Make sure that in tMap you have checked the 'nullable' checkbox , which is near the name of your variable (unchecked by default)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much Corentin !
Iv've never noticed that checkbox before !!!
"The devil is in the details"
