<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: java.lang.NullPointerException when setting a 'null' value in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316549#M87085</link>
    <description>Thanks,&lt;BR /&gt;But I'd like to keep my 'null' value. I don't want to set '0' if it's 'null'.</description>
    <pubDate>Thu, 19 Apr 2012 12:29:14 GMT</pubDate>
    <dc:creator>NicolasTT</dc:creator>
    <dc:date>2012-04-19T12:29:14Z</dc:date>
    <item>
      <title>java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316545#M87081</link>
      <description>Hello,
&lt;BR /&gt;I am faced with a 'java.lang.NullPointerException' when I set a null value in a (nullable) field a table of my database.
&lt;BR /&gt;Here's the scenario:
&lt;BR /&gt;An external source (my tFixedFlowInput in my example) can have a value and then change the value in base, or have no value, and in this case, I set the previous value to the base.
&lt;BR /&gt;This works, except in the case I have no value in either the external source, or in the database (null and null). In this case, I have a 'java.lang.NullPointerException' on the line corresponding to the value of the field in the TMap:
&lt;BR /&gt;
&lt;PRE&gt;temp_nva_out_tmp.isOK = !Relational.ISNULL(IN.isOK) ? 1 : temp_nva_in.isOK;&lt;/PRE&gt;
&lt;BR /&gt;I do not understand how the assignment of the null can generate
&lt;BR /&gt;'java.lang.NullPointerException'. If I replace temp_nva_in.isOK by 'null', it works correctly.
&lt;BR /&gt;Thanks for ideas,</description>
      <pubDate>Thu, 19 Apr 2012 10:29:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316545#M87081</guid>
      <dc:creator>NicolasTT</dc:creator>
      <dc:date>2012-04-19T10:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316546#M87082</link>
      <description>Hi
&lt;BR /&gt;It's a rule that you can type null in expression. But if expression get null from a variable, it will cause NPE exception.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 19 Apr 2012 10:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316546#M87082</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-19T10:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316547#M87083</link>
      <description>My expression is :
&lt;BR /&gt;!Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK
&lt;BR /&gt;is the Tmap.
&lt;BR /&gt;In the java code :
&lt;BR /&gt;
&lt;PRE&gt;// # Output table : 'temp_nva_out'&lt;BR /&gt;	temp_nva_out_tmp.uid = in.uid;&lt;BR /&gt;	temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK;&lt;BR /&gt;	temp_nva_out = temp_nva_out_tmp;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2012 10:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316547#M87083</guid>
      <dc:creator>NicolasTT</dc:creator>
      <dc:date>2012-04-19T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316548#M87084</link>
      <description>Hi&lt;BR /&gt;It seems that there are null values in temp_nva_in.isOK.&lt;BR /&gt;You can put a tJavaRow between the input component and tMap and type code as follow.&lt;BR /&gt;&lt;PRE&gt;if(input_row.isOk==null)&lt;BR /&gt;output_row.isOk = 0;&lt;/PRE&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 19 Apr 2012 11:09:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316548#M87084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-19T11:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316549#M87085</link>
      <description>Thanks,&lt;BR /&gt;But I'd like to keep my 'null' value. I don't want to set '0' if it's 'null'.</description>
      <pubDate>Thu, 19 Apr 2012 12:29:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316549#M87085</guid>
      <dc:creator>NicolasTT</dc:creator>
      <dc:date>2012-04-19T12:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316550#M87086</link>
      <description>&lt;PRE&gt;temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? new Integer( 1 ) : temp_nva_in.isOK;&lt;/PRE&gt;&lt;BR /&gt;works and &lt;BR /&gt;&lt;PRE&gt;temp_nva_out_tmp.isOK = !Relational.ISNULL(in.isOK) ? 1 : temp_nva_in.isOK;&lt;/PRE&gt;&lt;BR /&gt;doesn't work.&lt;BR /&gt;I don't understand why. Thanks if you could explain me?</description>
      <pubDate>Thu, 19 Apr 2012 13:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316550#M87086</guid>
      <dc:creator>NicolasTT</dc:creator>
      <dc:date>2012-04-19T13:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316551#M87087</link>
      <description>&lt;P&gt;&lt;B&gt;Initial stage of talend every one face a Null pointer exception ​, for TALEND TECH SUPPORT JION https://t.me/talendtechsupport&lt;/B&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 02:32:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316551#M87087</guid>
      <dc:creator>Ravivarma_india</dc:creator>
      <dc:date>2021-06-29T02:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NullPointerException when setting a 'null' value</title>
      <link>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316552#M87088</link>
      <description>&lt;P&gt;Hi, it's due to ternary autoboxing, in the first one it reads the left part as an Integer (it's a wrapper Object wich accept null value) so it will convert temp_nva_in.isOK to Integer&lt;/P&gt;&lt;P&gt;in the second one you set 1 on the left it will read it as an int and convert it as an int(doesn't support null values it's a primitive type) so it throw null pointer exception if temp_nva_in.isOK is null.&lt;/P&gt;&lt;P&gt;you could also write :&lt;/P&gt;&lt;P&gt;temp_nva_out_tmp.isOK = in.isOK != null? new Integer( 1 ) : temp_nva_in.isOK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Send me Love and Kudos&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 07:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/java-lang-NullPointerException-when-setting-a-null-value/m-p/2316552#M87088</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-06-29T07:24:00Z</dc:date>
    </item>
  </channel>
</rss>

