<?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: Null pointer exception in tjava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354701#M120612</link>
    <description>You can write it as a sub-element as well. Did you also change the input column to string in write json field? 
&lt;BR /&gt; 
&lt;BR /&gt;You can put a tlogrow before the json component to see exactly what data is coming out of the tmap and going to the json writer. 
&lt;BR /&gt; 
&lt;BR /&gt;You can remove all of the fields from your json writer and then add them back one by one until you get the error to see which field is causing it.</description>
    <pubDate>Fri, 07 Jun 2019 09:58:14 GMT</pubDate>
    <dc:creator>nfz11</dc:creator>
    <dc:date>2019-06-07T09:58:14Z</dc:date>
    <item>
      <title>Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354695#M120606</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am very new to Talend.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am getting the below error while executing a talend job which transfers data from oracle database to json.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;the intial design was,&lt;/P&gt; 
&lt;P&gt;tdbinput ---&amp;gt; tmap ---&amp;gt; twritejsonfields&lt;/P&gt; 
&lt;P&gt;since I got int to String type mismatch error, I have introduced tjava component and converted the column to string. &lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="jobdesign_talend.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5F9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136906i17A3491D97F9AE0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5F9.png" alt="0683p000009M5F9.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mapping_talend.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5MP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142433i4F36BEC0225832BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5MP.png" alt="0683p000009M5MP.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tjava_talend.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5Sl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149337i183741FD117BF069/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5Sl.png" alt="0683p000009M5Sl.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5PF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153395i1E05730C03357FC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5PF.png" alt="0683p000009M5PF.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;The job execution is failing now with the below error.&lt;/P&gt; 
&lt;P&gt;Please help me in resolving.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Starting job JOB_PT_ORA_TO_JSON_LOCATION_INFO at 11:00 06/06/2019.&lt;/P&gt; 
&lt;P&gt;[statistics] connecting to socket on port 3883&lt;BR /&gt;[statistics] connected&lt;BR /&gt;Exception in component tJava_1 (JOB_PT_ORA_TO_JSON_LOCATION_INFO)&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.tDBInput_2Process(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:3046)&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.runJobInTOS(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:6606)&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.main(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:6432)&lt;BR /&gt;[FATAL]: etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO - tJava_1 null&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.tDBInput_2Process(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:3046)&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.runJobInTOS(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:6606)&lt;BR /&gt;&amp;nbsp;at etl_poc_v2.job_pt_ora_to_json_location_info_0_1.JOB_PT_ORA_TO_JSON_LOCATION_INFO.main(JOB_PT_ORA_TO_JSON_LOCATION_INFO.java:6432)&lt;BR /&gt;[statistics] disconnected&lt;/P&gt; 
&lt;P&gt;Job JOB_PT_ORA_TO_JSON_LOCATION_INFO ended at 11:00 06/06/2019. [exit code=1]&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in Advance!&lt;/P&gt; 
&lt;P&gt;Best Regards,&lt;/P&gt; 
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 06:46:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354695#M120606</guid>
      <dc:creator>PRIYABOSCH</dc:creator>
      <dc:date>2019-06-06T06:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354696#M120607</link>
      <description>&lt;P&gt;Are you new to Java?&amp;nbsp; If not, you can debug this kind of error by looking at the 'Code' tab and finding the line with the red error.&amp;nbsp; You can inspect the generated Java code there.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You should really use a tJavaRow here.&amp;nbsp; Either way, both tJava and tJavaRow do not pass the variables onto the next component.&amp;nbsp; So all values will be null at your tWriteJSONField component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am not sure where or why you got an int to String type mismatch error.&amp;nbsp; You don't need a Java component there, you can do the conversion of the BigDecimal to a String in your tMap.&amp;nbsp; In the AVP_STANDARD_ALGORITHM column in out_map, make it a String type and put row1.AVP_STANDARD_ALGORITHM.toString()&amp;nbsp; as the expression.&amp;nbsp; Propagate the type change down the line.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Also, the code in your tJava does nothing.&amp;nbsp; You are not assigning the result to a variable.&amp;nbsp; It does not convert inline like that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 08:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354696#M120607</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-06-06T08:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354697#M120608</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006yqfZAAQ"&gt;@nfz11&lt;/A&gt;&amp;nbsp;thanks a ton for your reply. I have modified my job. I have removed the tjava component. I am getting type mismatch int to string converstion error after mapping tmap --&amp;gt; tjsonwritefield.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;row1.AVP_STANDARD_ALGORITHM.toString() -&amp;gt; is also not converting in tmap.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;please help me in resolving the issue.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P align="left"&gt;Error in the component's properties:Type mismatch: cannot convert from int to String&lt;/P&gt; 
&lt;P align="left"&gt;The method put(String, String) in the type Map&amp;lt;String,String&amp;gt; is not applicable for the arguments (String, ((tjsonout.MANIPULATE_EVENTS != null) ? tjsonout.MANIPULATE_EVENTS.toPlainString() : 0))&lt;/P&gt; 
&lt;P align="left"&gt;Type mismatch: cannot convert from int to String&lt;/P&gt; 
&lt;P align="left"&gt;The method put(String, String) in the type Map&amp;lt;String,String&amp;gt; is not applicable for the arguments (String, ((tjsonout.MANUALLY_INSERTED_PARTS != null) ? tjsonout.MANUALLY_INSERTED_PARTS.toPlainString() : 0))&lt;/P&gt; 
&lt;P align="left"&gt;Type mismatch: cannot convert from int to String&lt;/P&gt; 
&lt;P align="left"&gt;The method put(String, String) in the type Map&amp;lt;String,String&amp;gt; is not applicable for the arguments (String, ((tjsonout.AVP_STANDARD_ALGORITHM != null) ? tjsonout.AVP_STANDARD_ALGORITHM.toPlainString() : 1))&lt;/P&gt; 
&lt;P align="left"&gt;Type mismatch: cannot convert from int to String&lt;/P&gt; 
&lt;P&gt;The method put(String, String) in the type Map&amp;lt;String,String&amp;gt; is not applicable for the arguments (String, ((tjsonout.DISABLED != null) ? tjsonout.DISABLED.toPlainString() : 0))&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best Regards,&lt;/P&gt; 
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 10:35:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354697#M120608</guid>
      <dc:creator>PRIYABOSCH</dc:creator>
      <dc:date>2019-06-06T10:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354698#M120609</link>
      <description>&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tostring.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5PG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150525i84CE95CE08FC3173/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5PG.png" alt="0683p000009M5PG.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;here is my tmap screenshot with toString(). the direct mapping without any conversion is running fine if I directly load the data to Database. I am getting conversion error only when mapping to tjsonwritefileld component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please let me know your comments.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best Regards,&lt;/P&gt; 
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 10:42:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354698#M120609</guid>
      <dc:creator>PRIYABOSCH</dc:creator>
      <dc:date>2019-06-06T10:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354699#M120610</link>
      <description>&lt;P&gt;You need to change the type to String for those columns such as AVP_STANDARD_ALGORITHM in the schema editor of out_tmap in the lower right of the map editor.&amp;nbsp; Right now they are still BigDecimal.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 17:34:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354699#M120610</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-06-06T17:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354700#M120611</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006yqfZAAQ"&gt;@nfz11&lt;/A&gt;&amp;nbsp;yes I tried changing the output column also as String. Eventhough it is failing with same error.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I suspect something needs to be changed in TJSONWRITEFILED component. please let me know whether I should create as attribute for bigdecimal datatype columns. here I have created as add subelement like we keep for String.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="json.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5ML.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147496iCE87AA2D521923FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5ML.png" alt="0683p000009M5ML.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;Best Regards,&lt;/P&gt; 
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 07:21:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354700#M120611</guid>
      <dc:creator>PRIYABOSCH</dc:creator>
      <dc:date>2019-06-07T07:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354701#M120612</link>
      <description>You can write it as a sub-element as well. Did you also change the input column to string in write json field? 
&lt;BR /&gt; 
&lt;BR /&gt;You can put a tlogrow before the json component to see exactly what data is coming out of the tmap and going to the json writer. 
&lt;BR /&gt; 
&lt;BR /&gt;You can remove all of the fields from your json writer and then add them back one by one until you get the error to see which field is causing it.</description>
      <pubDate>Fri, 07 Jun 2019 09:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354701#M120612</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-06-07T09:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354702#M120613</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000006yqfZAAQ"&gt;@nfz11&lt;/A&gt;&amp;nbsp;as you suggested I tried adding column by column and checked, I faced issues&amp;nbsp;in 4 columns which has some default values in tmap. if I remove the default value for the columns it is working fine.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsonissue.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5Va.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135131iE9FB8F4811169D6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5Va.png" alt="0683p000009M5Va.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;what needs to be done if we should&amp;nbsp;to keep default values also and run without facing int to string error.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best Regards,&lt;/P&gt; 
&lt;P&gt;Priya&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354702#M120613</guid>
      <dc:creator>PRIYABOSCH</dc:creator>
      <dc:date>2019-06-07T12:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Null pointer exception in tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354703#M120614</link>
      <description>&lt;P&gt;Default values are not supported in tMap in 6.2 it looks like:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.talend.com/reader/I5~nujSNXadpT4WYWRHrjw/NnnMrtkRENP9mpQw6MrDHA" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://help.talend.com/reader/I5~nujSNXadpT4WYWRHrjw/NnnMrtkRENP9mpQw6MrDHA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;They may be supported now, I am not sure.&amp;nbsp; You could test it by using a default like "x" for a String field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also try quoting the default value for your BigDecimal, like "1".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can implement your default values in the row expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;row1.AVP_STANDARD_ALGORITHM != null ? row1.AVP_STANDARD_ALGORITHM : new BigDecimal("1")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 19:21:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-pointer-exception-in-tjava/m-p/2354703#M120614</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-06-07T19:21:27Z</dc:date>
    </item>
  </channel>
</rss>

