<?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: Catch and re-throw java errors in a tLogCatcher in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368815#M132037</link>
    <description>Hi Dadumas,
&lt;BR /&gt;Cud u tell me wat have u written in ur tJavaFlex and tOracleRow component to log exceptions in Databasetable.</description>
    <pubDate>Wed, 26 May 2010 11:56:44 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2010-05-26T11:56:44Z</dc:date>
    <item>
      <title>Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368811#M132033</link>
      <description>In my job architecture, I place a tLogCatcher in my jobs (screen shot attached). When errors are caught by the tLogCatcher , I then log these errors to a database message table. I also output to stats and log files. For the most part this works fine However, if I leave "Catch Java Exception" unchecked in tLogCatcher , I cannot log java errors to my database table - they do appear in the log file. if I leave check the "Catch Java Exception" option, java errors do not appear in the log file - they do appear in the database table. I want the java errors to appear in BOTH the database table and log file.
&lt;BR /&gt;So, my question is, is there a way to check the "Catch Java Exception" option in tLogCatcher, then continue with the tLogCatcher flow in my screen shot (logs to database table), and then "rethrow" the error - Ex. throw the error to another tLogCatcher, which has the "Catch Java Exception" option unchecked?
&lt;BR /&gt;Dave</description>
      <pubDate>Sat, 16 Nov 2024 13:26:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368811#M132033</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368812#M132034</link>
      <description>Hello 
&lt;BR /&gt;Where do you log the exception into the file?
&lt;BR /&gt;Anyway, if you unchec the 'catch jave exception' box on tLogCatcher component, it don't catch any java exception and log them into database. In your case, If you want to log the exception message both into database and file, you can use tReplicate to replicate the row many time as need.
&lt;BR /&gt;For example:
&lt;BR /&gt;tLogCatcher---treplicate---tOracleOutput
&lt;BR /&gt; |
&lt;BR /&gt; tFileOutputDelimited
&lt;BR /&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 29 Apr 2010 03:08:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368812#M132034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-29T03:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368813#M132035</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hello &lt;BR /&gt;Where do you log the exception into the file?&lt;BR /&gt;Anyway, if you unchec the 'catch jave exception' box on tLogCatcher component, it don't catch any java exception and log them into database. In your case, If you want to log the exception message both into database and file, you can use tReplicate to replicate the row many time as need.&lt;BR /&gt;For example:&lt;BR /&gt;tLogCatcher---treplicate---tOracleOutput&lt;BR /&gt; |&lt;BR /&gt; tFileOutputDelimited&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Shong&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hi shong,
&lt;BR /&gt;In project settings, I define stats and log output - that works great (see new screen shot). Your treplicate solution looks interesting - I will try that as well.
&lt;BR /&gt;Shong - I found a reproduceable bug. This occurs whether "catch java exceptions" is checked or un-checked. If an exception is caught above in the tLogCatcher, and then tOracleOutput fails because it CANNOT connect to the database, then the original error is lost, and it does not get output to the file system log file. However, If an exception is caught above in the tLogCatcher, and then tOracleOutput fails AFTER it connect to the database (causes an oracle exception during the dml operation, for example), then the original error is NOT lost, and it does get output to the file system log file.
&lt;BR /&gt;I can reproduce this bug every time - maybe your tReplicate will be a workaround to it - will try that.</description>
      <pubDate>Thu, 29 Apr 2010 13:21:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368813#M132035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-29T13:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368814#M132036</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hello &lt;BR /&gt;Where do you log the exception into the file?&lt;BR /&gt;Anyway, if you unchec the 'catch jave exception' box on tLogCatcher component, it don't catch any java exception and log them into database. In your case, If you want to log the exception message both into database and file, you can use tReplicate to replicate the row many time as need.&lt;BR /&gt;For example:&lt;BR /&gt;tLogCatcher---treplicate---tOracleOutput&lt;BR /&gt; |&lt;BR /&gt; tFileOutputDelimited&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Shong&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Shong,
&lt;BR /&gt;I replied twice to this (your reply), so please read both of my replies. This reply is for the results of using tReplicate to a tFileOutputDelimited. As long as the tFileOutputDelimited is first in order precedence (main) , prior to tOracleOutput, your solution works great,
&lt;BR /&gt;Thanks!
&lt;BR /&gt;
&lt;BR /&gt;See attached screen shot .
&lt;BR /&gt;Dave</description>
      <pubDate>Thu, 29 Apr 2010 17:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368814#M132036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-29T17:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368815#M132037</link>
      <description>Hi Dadumas,
&lt;BR /&gt;Cud u tell me wat have u written in ur tJavaFlex and tOracleRow component to log exceptions in Databasetable.</description>
      <pubDate>Wed, 26 May 2010 11:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368815#M132037</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2010-05-26T11:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Catch and re-throw java errors in a tLogCatcher</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368816#M132038</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi Dadumas,&lt;BR /&gt;Cud u tell me wat have u written in ur tJavaFlex and tOracleRow component to log exceptions in Databasetable.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Sure. For the database , I have an ETL framework that I have used for years, not just for Talend - logs meta data throughout the job. Part of that is a message log table. 
&lt;BR /&gt;Take a look at the screen shot, and then... 
&lt;BR /&gt;In the tJavaFlex: 
&lt;BR /&gt;context.SuccessFlag = 0; 
&lt;BR /&gt;context.Message = "For last Message: " + context.Message + ", Failure, in tLogCatcher, job failed, see message log for details, ERROR: " 
&lt;BR /&gt;+ row5.message; 
&lt;BR /&gt;row5.Message is the error message coming from tLogCatcher. 
&lt;BR /&gt;Then in the tOracleRow: 
&lt;BR /&gt;" 
&lt;BR /&gt;INSERT INTO STGETLMESSAGELOG 
&lt;BR /&gt;(LOGID, 
&lt;BR /&gt;JOBID, 
&lt;BR /&gt;JOBRUNID, 
&lt;BR /&gt;CREATEDDATE, 
&lt;BR /&gt;MESSAGE, 
&lt;BR /&gt;SUCCESSFLAG, 
&lt;BR /&gt;PROCESSNAME, 
&lt;BR /&gt;SUBPROCESSNAME) 
&lt;BR /&gt;VALUES 
&lt;BR /&gt;(STGETLLOGSEQ.NEXTVAL," 
&lt;BR /&gt;+ context.VPJobId + "," 
&lt;BR /&gt;+ context.JobRunId + "," 
&lt;BR /&gt;+ "TO_DATE(" + "'" + TalendDate.getDate("MM-DD-CCYY hh:mm:ss") + "'" + "," + "'" + "MM-DD-YYYY hh24:mi:ss" + "'" + ")," 
&lt;BR /&gt;+ "'" + context.Message + "'" + "," 
&lt;BR /&gt;+ context.SuccessFlag + "," 
&lt;BR /&gt;+ "'" + context.ProcessName + "'" + "," 
&lt;BR /&gt;+ "'" + context.SubProcessName + "'" 
&lt;BR /&gt;+ ")" 
&lt;BR /&gt;Hope this helps. 
&lt;BR /&gt;Dave</description>
      <pubDate>Fri, 28 May 2010 14:48:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Catch-and-re-throw-java-errors-in-a-tLogCatcher/m-p/2368816#M132038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-28T14:48:49Z</dc:date>
    </item>
  </channel>
</rss>

