<?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: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330848#M99889</link>
    <description>Hi All, 
&lt;BR /&gt;I resolved this issue in following way : 
&lt;BR /&gt; 
&lt;B&gt;Parent job&lt;/B&gt; :we need to define a ConcurrentHashMap in parent job 
&lt;BR /&gt;globalMap.put("sharedMap", new java.util.concurrent.ConcurrentHashMap()); 
&lt;BR /&gt; 
&lt;B&gt;Child job&lt;/B&gt; : Define a context variable of type object here for ex:sharedMap 
&lt;BR /&gt;((java.util.Map)context.sharedMap).put("test", "test123"); 
&lt;BR /&gt;((java.util.Map)context.sharedMap).put("hello","hello123"); 
&lt;BR /&gt;Configure 
&lt;B&gt;tRunjob&lt;/B&gt; in 
&lt;B&gt;parent job&lt;/B&gt; like below : 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Retrieve the values in Parent job like below&lt;/B&gt;: 
&lt;BR /&gt;System.out.println("test&amp;gt;&amp;gt;"+((java.util.Map)globalMap.get("sharedMap")).get("test")); 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt;System.out.println("hello&amp;gt;&amp;gt;"+((java.util.Map)globalMap.get("sharedMap")).get("hello")); 
&lt;BR /&gt; 
&lt;B&gt;output :&lt;/B&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt;</description>
    <pubDate>Thu, 11 Sep 2014 08:22:29 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2014-09-11T08:22:29Z</dc:date>
    <item>
      <title>[resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330843#M99884</link>
      <description>Hi All, 
&lt;BR /&gt;I have two jobs called parent and child job.parent job will call child job and child job will return some result to parent job. 
&lt;BR /&gt;Parent and child jobs will look like below : 
&lt;BR /&gt;tjava : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;tFixedFlowInput schema : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt;tBufferOutput schema : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Child job : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;Parent job : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;tRunJob Schema: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;tJavaRow will looks like below : 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;But when I execute the parent job I'm getting an exception like 
&lt;B&gt;tBufferOutput:java.util.HashMap cannot be cast to java.lang.String&lt;/B&gt;.Am I doing something wrong? Is there any other alternative way to return childjob result to the parent job? 
&lt;BR /&gt;Can any one please advice me on this. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;Thanks in advance, 
&lt;BR /&gt;Sayagoud Ravelly</description>
      <pubDate>Tue, 26 Aug 2014 14:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330843#M99884</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-08-26T14:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330844#M99885</link>
      <description>You have misunderstood the Talend type List. List means a couple of Strings which can be selected in a combobox (e.g. for a prompt). Use the Talend type Object.</description>
      <pubDate>Tue, 26 Aug 2014 22:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330844#M99885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-26T22:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330845#M99886</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;You have misunderstood the Talend type List. List means a couple of Strings which can be selected in a combobox (e.g. for a prompt). Use the Talend type Object.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi jlolling, 
&lt;BR /&gt;Thanks for your reply.I have tried the way you suggested but got a similar exception like below in parent job. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt;</description>
      <pubDate>Wed, 27 Aug 2014 06:56:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330845#M99886</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-08-27T06:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330846#M99887</link>
      <description>You have to change the type for the context variable in both jobs (parent and child).</description>
      <pubDate>Wed, 27 Aug 2014 10:19:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330846#M99887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-27T10:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330847#M99888</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;You have to change the type for the context variable in both jobs (parent and child).&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi jlolling, 
&lt;BR /&gt;I configured the context variable in child job as of type Object. 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;But in Parent job I'm using 
&lt;B&gt;input_row.ListObject&lt;/B&gt; directly from the trunjob flow like below. 
&lt;BR /&gt;&amp;nbsp;List&amp;lt;HashMap&amp;lt;String,HashMap&amp;lt;String, String&amp;gt;&amp;gt;&amp;gt; childjob_list = (List&amp;lt;HashMap&amp;lt;String,HashMap&amp;lt;String, String&amp;gt;&amp;gt;&amp;gt;)input_row.ListObject; 
&lt;BR /&gt;And also tried by defining the same context in parent job like below but no luck,getting same exception. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt;List&amp;lt;HashMap&amp;lt;String,HashMap&amp;lt;String, String&amp;gt;&amp;gt;&amp;gt; childjob_list = (List&amp;lt;HashMap&amp;lt;String,HashMap&amp;lt;String, String&amp;gt;&amp;gt;&amp;gt;)input_row.ListObject;</description>
      <pubDate>Wed, 27 Aug 2014 15:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330847#M99888</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-08-27T15:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330848#M99889</link>
      <description>Hi All, 
&lt;BR /&gt;I resolved this issue in following way : 
&lt;BR /&gt; 
&lt;B&gt;Parent job&lt;/B&gt; :we need to define a ConcurrentHashMap in parent job 
&lt;BR /&gt;globalMap.put("sharedMap", new java.util.concurrent.ConcurrentHashMap()); 
&lt;BR /&gt; 
&lt;B&gt;Child job&lt;/B&gt; : Define a context variable of type object here for ex:sharedMap 
&lt;BR /&gt;((java.util.Map)context.sharedMap).put("test", "test123"); 
&lt;BR /&gt;((java.util.Map)context.sharedMap).put("hello","hello123"); 
&lt;BR /&gt;Configure 
&lt;B&gt;tRunjob&lt;/B&gt; in 
&lt;B&gt;parent job&lt;/B&gt; like below : 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt; 
&lt;BR /&gt; 
&lt;B&gt;Retrieve the values in Parent job like below&lt;/B&gt;: 
&lt;BR /&gt;System.out.println("test&amp;gt;&amp;gt;"+((java.util.Map)globalMap.get("sharedMap")).get("test")); 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt;System.out.println("hello&amp;gt;&amp;gt;"+((java.util.Map)globalMap.get("sharedMap")).get("hello")); 
&lt;BR /&gt; 
&lt;B&gt;output :&lt;/B&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.qlik.com/" /&gt;</description>
      <pubDate>Thu, 11 Sep 2014 08:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330848#M99889</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-09-11T08:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330849#M99890</link>
      <description>Attempting to follow this recipe to draw out the context titled "Failed_Dir" from the sub-job.&lt;BR /&gt;I put in "sharedMap" as a context variable with the type as Object.&lt;BR /&gt;tjava2 --&amp;gt; tRunJob1 --&amp;gt; tJava3&lt;BR /&gt;1) tJava2 - globalMap.put("sharedMap", new java.util.concurrent.ConcurrentHashMap());&lt;BR /&gt;2a) tRunJob1 - Setting as sharedMap and Value: (java.util.Map)globalMap.get("sharedMap")&lt;BR /&gt;2b) tjava 1 inside the Child Job - ((java.util.Map) context.sharedMap).put("Failed_Dir", context.Failed_Dir);&lt;BR /&gt;3) tjava3 - System.out.println("Failed_Dir=" + ((String) ((java.util.Map) globalMap.get("sharedMap")).get("Failed_Dir")));&lt;BR /&gt;&lt;BR /&gt;What I'm getting is:&lt;BR /&gt; connecting to socket on port 3485&lt;BR /&gt; connected&lt;BR /&gt;Exception in component tJava_3&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at spv.jo_spv_0010_ingestpolicyenginedata_02_new_0_2.jo_SPV_0010_IngestPolicyEngineData_02_NEW.tJava_2Process(jo_SPV_0010_IngestPolicyEngineData_02_NEW.java:3218)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at spv.jo_spv_0010_ingestpolicyenginedata_02_new_0_2.jo_SPV_0010_IngestPolicyEngineData_02_NEW.runJobInTOS(jo_SPV_0010_IngestPolicyEngineData_02_NEW.java:4549)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at spv.jo_spv_0010_ingestpolicyenginedata_02_new_0_2.jo_SPV_0010_IngestPolicyEngineData_02_NEW.main(jo_SPV_0010_IngestPolicyEngineData_02_NEW.java:3791)&lt;BR /&gt; disconnected&lt;BR /&gt;Job jo_SPV_0010_IngestPolicyEngineData_02_NEW ended at 17:29 14/09/2016. &lt;BR /&gt;Can anybody help?</description>
      <pubDate>Wed, 14 Sep 2016 19:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330849#M99890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-14T19:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tBufferOutput:java.util.HashMap cannot be cast to java.lang.String</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330850#M99891</link>
      <description>Just bumping this up so if anyone has any ideas?&lt;BR /&gt;Or should I put this as a new topic?</description>
      <pubDate>Mon, 19 Sep 2016 14:06:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tBufferOutput-java-util-HashMap-cannot-be-cast-to-java/m-p/2330850#M99891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-19T14:06:47Z</dc:date>
    </item>
  </channel>
</rss>

