<?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: NB_LINE nullpointerexception in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233967#M23486</link>
    <description>Hi
&lt;BR /&gt;Is it a rest web service or a route? I have tried to create a rest web service to reproduce the problem, I got the following error if no rows are found.&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;Exception in component tRESTClient_1&lt;BR /&gt;javax.ws.rs.NotFoundException&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)&lt;BR /&gt;	at &lt;/PRE&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;To resolve this exception, we can customize output message if no rows are found.&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;Best regards&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;Shong&lt;/FONT&gt;</description>
    <pubDate>Fri, 23 Jan 2015 11:14:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-23T11:14:28Z</dc:date>
    <item>
      <title>NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233963#M23482</link>
      <description>&lt;P&gt;Flow: tRESTreq -&amp;gt; tFlowToIter -&amp;gt; tOracleInput -&amp;gt; txmlMap -&amp;gt; tRestResp&lt;BR /&gt;In the xmlmap I am trying to perform flow control. For that I would need to distinguish between the number of line (tOracleInput_NB_LINE) being either 0 or 1 to set the condition for different xmlmap outputs. However as I globalMap.get("tOracleinput_3_NB_LINE") I get a nullpointer.&amp;nbsp;&lt;BR /&gt;I had a look at the code and it turns out that for some odd reason the variable scope for the xmlmap definitions is put in before where NB_LINE is inserted into the globalMap (about 50 lines below).&lt;BR /&gt;Is there any way around or is this a bug?&amp;nbsp;I have already tried using a tJavaRow between the two components but I get a "cannot refer to non-final variable" error. I cannot use onsubjob either since the code for that component also gets generated and executed after the variable scope of xmlmap.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 11:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233963#M23482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233964#M23483</link>
      <description>The global variable can be only used later on another subjob. With this job design, if you look into the generated code of job, you will see it gets the value before the value is set, that's why you get nullpointer exception. To resolve it, you have to re-design the job, for example:
&lt;BR /&gt;parent job:
&lt;BR /&gt;tRestReq-&amp;gt;tFlowToIterate--iterate--tRunJob--main-tRestResp
&lt;BR /&gt;tRunJob: call the child job and pass value from parent job to child job if needed, refer to this KB 
&lt;A href="https://help.talend.com/search/all?query=Passing+a+value+from+a+parent+Job+to+a+child+Job&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;article&lt;/A&gt;.
&lt;BR /&gt;child job:
&lt;BR /&gt;tOracleInput--main--tHashOutput
&lt;BR /&gt;&amp;nbsp; |
&lt;BR /&gt;tHashInput--main--tXMLMap--main--tBufferOutput
&lt;BR /&gt;on tXMLMap, you are able to access the Oracle NB_line varaible.
&lt;BR /&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 23 Jan 2015 01:31:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233964#M23483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T01:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233965#M23484</link>
      <description>Thanks a lot for the quick reply. I will definitely try your suggestion.&amp;nbsp;
&lt;BR /&gt;However in the meantime, Would you happen to know why does the route stop when I get 0 rows out of the database. Since the database contains hundreds of millions of rows, we cannot afford to have a lookup link between oracleinput and xmlmap so I chose this design to be able to include a where clause in the oracleinput and have it return only 1 row (or 0 row in case of no match). However in the case of executing the query and not finding a match in the database (0 rows case) the route actually stops at oracleinput. I am asking this since if it didn't, I would be able to easily have 2 outputs with conditions in the xmlmap checking for the input_row or row1 being null.</description>
      <pubDate>Fri, 23 Jan 2015 01:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233965#M23484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T01:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233966#M23485</link>
      <description>So I just implemented it the same way as you suggested before and I am still not getting any results for the no match case. I will try to explain the issue to the best of my abilities.&lt;BR /&gt;In the child job, going from oraclein to hashout in the case of no match (0 rows), it seems so that the route completely&amp;nbsp;&lt;B&gt;stops executing. &lt;/B&gt;I added a tjavarow between hashin and xmlmap which has some simple system.out and none of them gets printed out in the case of 0 rows but when there is a row coming out of the oraclein they do get printed out.&lt;BR /&gt;I am not sure what is happening here at all. It doesn't seem intuitive to me.&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 23 Jan 2015 03:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233966#M23485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T03:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233967#M23486</link>
      <description>Hi
&lt;BR /&gt;Is it a rest web service or a route? I have tried to create a rest web service to reproduce the problem, I got the following error if no rows are found.&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;Exception in component tRESTClient_1&lt;BR /&gt;javax.ws.rs.NotFoundException&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)&lt;BR /&gt;	at &lt;/PRE&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;To resolve this exception, we can customize output message if no rows are found.&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;Best regards&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;Shong&lt;/FONT&gt;</description>
      <pubDate>Fri, 23 Jan 2015 11:14:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233967#M23486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-23T11:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233968#M23487</link>
      <description>Hi,&lt;BR /&gt;Here is my design. The top picture is the main job and you see two rows going out from the restRequest. Top row being my original design and the bottom one being the new design using runJob. The bottom picture depicts the job that gets run by the runJob.&lt;BR /&gt;As you can see in the pictures there are 0 rows going out in the sub job. This is the case of "no match" in the database. Now here is my question: In the bottom picture I have two outputs in the xmlmap. the getRMUResponse is the usual response but getRMUfault is the top output and has a condition ((Integer) globalMap("tOracleInput_3_NB_LINE)) == 0). This is where I have the error. That key in the globalMap doesnt exist and I get the nullpointer exception.&amp;nbsp;&lt;BR /&gt;How would I be able to fix this? Right now I get an empty response in the case of "no match" in the database and a correct response in the case of a match. &amp;nbsp;&lt;BR /&gt;&lt;A href="http://imgur.com/iC69xqy,cVG7Pp9#1" rel="nofollow noopener noreferrer"&gt;http://imgur.com/iC69xqy,cVG7Pp9#1&lt;/A&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Main job&lt;BR /&gt;&lt;A href="http://imgur.com/iC69xqy,cVG7Pp9#0" rel="nofollow noopener noreferrer"&gt;http://imgur.com/iC69xqy,cVG7Pp9#0&lt;/A&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sub job&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 26 Jan 2015 23:07:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233968#M23487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-26T23:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: NB_LINE nullpointerexception</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233969#M23488</link>
      <description>Hi 
&lt;BR /&gt;You uploaded two same pictures, I don't know where do you set the expression ((Integer) globalMap("tOracleInput_3_NB_LINE)) == 0), can you please export the job and send it to me for further investigation? 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 29 Jan 2015 08:15:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NB-LINE-nullpointerexception/m-p/2233969#M23488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-29T08:15:29Z</dc:date>
    </item>
  </channel>
</rss>

