One Star

[resolved] tLogCatcher does not catch Java Exception

Hi,
I have a job which does some work, and calls some subjobs. This main work is connected by a flow and has one start point (highlighted as green).
I want every Java exception been kept by tLogCatcher.
I created a tLogCather job as standalone job (not within the main flow). One sub job follows the tLogCatcher. The sub job shall make some entries in my databases log-table. The tLogCatcher is also highlighted as green and "catch Java Exceptions" is checked, tDie and tWarn isnt checked.
I found this Thread which unfortunately stays unsolved. There one told about a checkbox for multithreading. I do not have such an option for tLogCatcher.
Well when executing my job the console shows an Java exception. I do not understand why my log job isnt called.
One thought, I was not able to find an answer on is if I need to create a tlogCather on every subjob or if its enough to have one on the main job.
For further imagination here are some Screenshots about my job and the options of tLogCatcher.
Any help would be grateful. Thanks in advance.

27 REPLIES
Moderator

Re: [resolved] tLogCatcher does not catch Java Exception

Hi Kaspatoo,
I created a tLogCather job as standalone job (not within the main flow). One sub job follows the tLogCatcher. The sub job shall make some entries in my databases log-table. The tLogCatcher is also highlighted as green and "catch Java Exceptions" is checked, tDie and tWarn isnt checked.

Your screenshots of job design will be preferred. Did you connect your tLogCatcher component to toutput component to save java exception log?(tLogrow-->touput)? What's the subjob which makes some entries in your databases log-table?
Here are Stat&log option in project setting ( it  is working on the whole project (Parent job and child jobs, and output them on file/DB but no context setting).
 and Stat&log in job view is working on the current job (you should set Stat&log of job view in both parent job and child jobs and output them on file/DB with context setting).
Best regards
Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

hm well my screenshots are missing now, yesterday they were shown in my post
heres my next try, else i am going to load them externally:
Two Stars

Re: [resolved] tLogCatcher does not catch Java Exception

Hi Kaspatoo,
 I need to create a tlogCather on every subjob >>
As you are thinking, it is not possible to catch logs and errors by a subjob for parent job... You need to have logcatcher component for every job...
If you want to avoid repeat target location, what you can do is, use tlogcatcher in every job and redirect all the records to single subjob which will insert data into the target location.
Vaibhav
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

fileupload wont work
here are the external images:
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

well hes not even showing the links
thats stupid....
I try links with a broken URL, so delete spaces within them please, im sorry for that
htt p://w ww. file-upload.net/download-9301676/main_job.PNG.html
htt p://w ww. file-upload.net/download-9301673/option_advanced.PNG.html
htt p://w ww. file-upload.net/download-9301674/option_base.PNG.html
htt p://w ww. file-upload.net/download-9301677/option_documentation.PNG.html
htt p://w ww. file-upload.net/download-9301678/option_dynamic.PNG.html
htt p://w ww. file-upload.net/download-9301679/option_view.PNG.html
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

@xdshi: documentation only says that with "stats & logs" i would be able to monitor logs.
So I now do not know what it really does? when using "use logs (tLogCatche)" will it then catch all exceptions as I want?
Does any tLogcatcher only work when the checkbox "use logs (tLogCatche)" in "stats & logs" is checked?
Whats the difference using a tLogCatcher and not havin checked "use logs (tLogCatche)" and having it checked?
and yes my tLogCatcher is connected to a DBout but via subjob. The exceptions says "premature end of file" on VALIDATE XML (which is running in main job and not any subjob). So the error does not occur after tLogcatcher caught it if you were one the way to imply this.
@sanvaibhav: well thanks, could explain it, but my colleage who programmed it in past is sure about havin tested it catching exceptions from subjobs. Well I am going to have a test on it.
Moderator

Re: [resolved] tLogCatcher does not catch Java Exception

Hi,
tLogcatcher fetches set fields and messages from Java Exception, tDie and/or tWarn and passes them on to the next component.
Does any tLogcatcher only work when the checkbox "use logs (tLogCatche)" in "stats & logs" is checked?

You can use component(tLogcatcher) to catch java exception separately. If you use Stat&log option in project setting or Stat&log in job view, you have to check out "use logs (tLogCatche)" to enable it.
and yes my tLogCatcher is connected to a DBout but via subjob. The exceptions says "premature end of file" on VALIDATE XML (which is running in main job and not any subjob). So the error does not occur after tLogcatcher caught it if you were one the way to imply this.

Is there any java exception info printed on console?
We cannot see your external images you provided. Can you use "upload" or "Drop files here to attachement" to upload them? What's the error your are facing?
See my pics
Best regards
Sabrina


--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

Hi, 
If you use Stat&log option in project setting or Stat&log in job view, you have to check out "use logs (tLogCatche)" to enable it.

Yeah fine but what does it do? Catch now all Java exceptions in all jobs and subjobs? And what then? does it write the Exceptiontext or trace? Am I able to instead write a message like "an error occured"?
Errortext on console is in red letters:
"Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file."
did you delete the blanks in the URL?
This is my failure description for inserting images:
Forum - Problem
Hi,
on a forumpost

I was not able to insert screenhots.
The postfield offered me to interactiv fields to drag&drop files or copy&paste images.
I tried using drag and drop png-files of size about 50kb. It did not work while giving me a failmessage that the uploaded file would not meet requirements.
Clicking a png file from my desktop, clicking + to copy it, then click in forum post area on the interactive field "dopy&paste screenshots" and then click +

to paste it will upload the image and show a thumbnail under my post-text. All looking fine. When click on post my post is posted but without any screenshot.
When now clicking in toolbar above the next answer-area on "upload" it will show me my screenshots but I cannot successfully drag them to my post area.
Due to this I tried to insert URLs of my png files now externally uploaded but the post is postet without the URLs.
I now did it with posting broken URLs (I inserted some blanks).
A Talend team member asked me to post screenshots. Well its not that easy.
You may should remove the new-user-blocks.
Thanks.

Moderator

Re: [resolved] tLogCatcher does not catch Java Exception

Hi,
Yeah fine but what does it do? Catch now all Java exceptions in all jobs and subjobs? And what then? does it write the Exceptiontext or trace? Am I able to instead write a message like "an error occured"?

Stat&log in project setting ( it  is working on the whole project (Parent job and child jobs, and output them on file/DB but no context setting).
Stat&log in job view is working on the current job (you should set Stat&log of job view in both parent job and child jobs and output them on file/DB with context setting).
You can choose to write the Exceptiontext into file or Database.
Am I able to instead write a message like "an error occured"?

You cannot do it when using Stat&log in job view or Stat&log in project setting.
You are able to achieve it by using tLogcatcher component(tLogcatcher-->tMap-->tfileoutputxxx). In tMap editor, you can replace exception message or keep both.
To make it clear, I have designed a simple demo job.
1: Using Stat&log in job view
2: Using tLogcatcher component(tLogcatcher-->tMap-->tfileoutputxxx) to replace exception message.
For 3 ways, Stat&log in project setting, Stat&log in job view or tLogcatcher, use either of them.
See my pics
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: [resolved] tLogCatcher does not catch Java Exception

Hi,
Hi,
on a forumpost
I was not able to insert screenhots.
The postfield offered me to interactiv fields to drag&drop files or copy&paste images.
I tried using drag and drop png-files of size about 50kb. It did not work while giving me a failmessage that the uploaded file would not meet requirements.
Clicking a png file from my desktop, clicking + to copy it, then click in forum post area on the interactive field "dopy&paste screenshots" and then click +

to paste it will upload the image and show a thumbnail under my post-text. All looking fine. When click on post my post is posted but without any screenshot.
When now clicking in toolbar above the next answer-area on "upload" it will show me my screenshots but I cannot successfully drag them to my post area.
Due to this I tried to insert URLs of my png files now externally uploaded but the post is postet without the URLs.
I now did it with posting broken URLs (I inserted some blanks).
A Talend team member asked me to post screenshots. Well its not that easy.
You may should remove the new-user-blocks.
Thanks.


Actually, there is no new-user-blocks for Image but URL. When you click "upload" button and upload files, make sure the uploaded screenshots is loaded in your current post.
See my screenshots.
Let me know if it is OK with you.
Best regards 
Sabrina
 
 
 
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

yeah my screenshot was shown as your second picture in the post-area
I hit submit button and the screenshots were not shown
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

 
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

even with another browser i am not able to insert images
i now clicked on upload, my uploaded pictures where listed/ shown there
I click at one image, the image is now displayed in the content area
when clicking submit as above the post is posted without any image
on preview the image is still shown
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

maybe I am able to send you images per mail?
if you want you can send me an email first on (pls delete blanks here again)
sebastian . krings @ atos . net
I try to describe again what I have:
a main job with some sub jobs
and some places the console logs red-colored-textlines, which are not the trace of a java exception but theyre errors, theyre red, I do not log red text.
The full console output of one run of the mainjob is exactly as follows:
ACTION    LEVEL    MESSAGE    TIMESTAMP_START    TIMESTAMP_END    SUCCESS
JOBNAME|ACTION|null|31-07-2014||
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
File is Invalid
There is a Fatal Error on line 1 : Premature end of file.
There is an Error on line 1 : Premature end of file.
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
There is a Fatal Error on line 1 : Premature end of file.
There is an Error on line 1 : Premature end of file.
File is Invalid
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
File is Invalid
There is a Fatal Error on line 1 : Premature end of file.
There is an Error on line 1 : Premature end of file.
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
File is Valid
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
Error on line 1 of document  : Premature end of file. Nested exception: Premature end of file.
File is Invalid
There is a Fatal Error on line 1 : Premature end of file.
There is an Error on line 1 : Premature end of file.

I have a tLogCatcher component, which flows to a subjob which makes a tmap before tDBOut
when setting a breakpoint on it, it is never called
On live application server the console shows the following outout:
ACTION LEVEL MESSAGE TIMESTAMP_START TIMESTAMP_END SUCCESS
ACTION LEVEL MESSAGE TIMESTAMP_START TIMESTAMP_END SUCCESS
FETCH_FILE|ERROR|(file not loaded - first try of three.
|
There isContinue_tFileFetch_1 an exception on: {>URL<}
java.lang.Exception: Method failed: HTTP/1.0 500 Internal Server Error
at package.file_fetcher_0_1.FILE_FETCHER.tFileFetch_1Process(FILE_FETCHER.java:851)
at package.file_fetcher_0_1.FILE_FETCHER.runJobInTOS(FILE_FETCHER.java:2124)
at package.file_fetcher_0_1.FILE_FETCHER.runJob(FILE_FETCHER.java:1803)
at package.fetch_file_worker_0_1.FETCH_FILE_WORKER.tRunJob_1Process(FETCH_FILE_WORKER.java:948)
at package.fetch_file_worker_0_1.FETCH_FILE_WORKER$2.run(FETCH_FILE_WORKER.java:2517)

There isContinue_tFileFetch_1 an exception on:{>URL<}
java.lang.Exception: Method failed: HTTP/1.0 500 Internal Server Error

at package.file_fetcher_0_1.FILE_FETCHER.tFileFetch_1Process(FILE_FETCHER.java:851)
at package.file_fetcher_0_1.FILE_FETCHER.runJobInTOS(FILE_FETCHER.java:2124)
at package.file_fetcher_0_1.FILE_FETCHER.runJob(FILE_FETCHER.java:1803)
at package.fetch_file_worker_0_1.FETCH_FILE_WORKER.tRunJob_3Process(FETCH_FILE_WORKER.java:1402)
at package.fetch_file_worker_0_1.FETCH_FILE_WORKER$4.run(FETCH_FILE_WORKER.java:2609)
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

I now found the code throwing the exception above:
                } catch (java.lang.Exception e) {
                    System.err
                            .println("There isContinue_tFileFetch_1 an exception on: "
                                    + context.file_pp_financial);
                    e.printStackTrace();
                    System.out.println("\r\n");
                    isContinue_tFileFetch_1 = false;
                }

I copied the tLogCatcher into the subjob where the component is located which throws the exception.
Why does Talend e.printStackTrace and not forward it to tLogCatcher?
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

i again try to upload pics since it worked now on another topic.
Some texts are may in german, ask for translation if needed.
Four Stars

Re: [resolved] tLogCatcher does not catch Java Exception

Hi Kaspatoo,
how do you pass the content from tLogCatcher to your sub job? Maybe you forgot to activate the checkbox "Transmit whole context" on tRunJob component?
Does a tLogRow catch the java exception when you put it between tLogCatcher and tRunJob?
Regards,
Frank
Seventeen Stars

Re: [resolved] tLogCatcher does not catch Java Exception

hi all,

File is Valid

I guess you're validate some data (with xsd validation ?).
to catch error from those component I think (if i have well understand your request) you have to use 'runf if' trigger and propagate in a tWarn or tDie (if you want to stop the process).
If you're using on subjob error or on component error it doesn't work because it's not an error about component but data.
hope I'm clear enought & hope it helps
regards
laurent
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

Hey,
- yes, XSD validation
- I do not transmitting whole context, but thats ok due to manuel transmitting of single parameters.
i mean when errors appear (by wrong/ missing data) the console shows red colored outputs and sometimes stacktraces from java exceptions (eg when my webserver is not available).
As I understand you now, these are no unhandled java exceptions but just their messages and stack traces after they were handled by the components and set for output by also these components. Thats why tLogCatcher has not been triggered, theres no unhandled exception.
Catching the handled erros by components I have to use run-if (which i still do for manual logging).
If I am right the "problem" then is, how to influence the outputs done automatically in console.
Seventeen Stars

Re: [resolved] tLogCatcher does not catch Java Exception

Catching the handled erros by components I have to use run-if (which i still do for manual logging)


for XSD validation, when an error occured due to non conforme schema, you've got red information telling you about the problem.
BUT it's not an error about the component ... so onComponentError or on SubJobError cannot work !
for that reason use run-if
about logs errors you can configure which one you want to catch.
regards
laurent

Seventeen Stars

Re: [resolved] tLogCatcher does not catch Java Exception

test with onComponentError + twarn
test run-if + twarn 
both of them are log on console
result with onComponent error :

Starting job xsdValidation at 11:46 03/09/2014.
connecting to socket on port 3688
connected
There is an Error on line 35 : Contenu non autorisé dans la section de fin.
File is Invalid
2014-09-03 11:46:38|mdrMTw|mdrMTw|mdrMTw|SANDBOX|xsdValidation|Default|4|tWarn|tWarn_2|XML Valide|42
disconnected
Job xsdValidation ended at 11:46 03/09/2014.



result with run-if 

Starting job xsdValidation at 11:50 03/09/2014.
connecting to socket on port 3601
connected
There is an Error on line 35 : Contenu non autorisé dans la section de fin.
File is Invalid
2014-09-03 11:50:46|sxquUz|sxquUz|sxquUz|SANDBOX|xsdValidation|Default|4|tWarn|tWarn_1| File is Invalid|42
disconnected
Job xsdValidation ended at 11:50 03/09/2014.


if you want to catch the cause of xsd is invalid , use the global var :
 
((String)globalMap.get("tXSDValidator_1_XSD_ERROR_MESSAGE"))

the whole message in tWarn (error one) :
((String)globalMap.get("tXSDValidator_1_ERROR_MESSAGE")) + "   " +  ((String)globalMap.get("tXSDValidator_1_XSD_ERROR_MESSAGE"))


for the result :

Starting job xsdValidation at 11:53 03/09/2014.
connecting to socket on port 3795
connected
There is an Error on line 35 : Contenu non autorisé dans la section de fin.
File is Invalid
2014-09-03 11:53:30|lKcovM|lKcovM|lKcovM|SANDBOX|xsdValidation|Default|4|tWarn|tWarn_1| File is Invalid   There is an Error on line 35 : Contenu non autorisé dans la section de fin.|42
disconnected
Job xsdValidation ended at 11:53 03/09/2014.


hope it helps
regards
laurent

One Star

Re: [resolved] tLogCatcher does not catch Java Exception

hey
you wrote "about logs errors you can configure which one you want to catch." and attached a screenshot.
What does this option mean? Is it like o over-global-tLogCatcher which prints all errors/ exception into console?
Does this option exists instead of other tLogCather or exist in addition? (Means on runtime errors its printed by this option to conosle and additionally the component tLogcather is triggered because of the exception or does then no other tLogCather be called?)
Seventeen Stars

Re: [resolved] tLogCatcher does not catch Java Exception

Seems to be a little confused about stats&logs and different way to use them.
please, read about that : 
https://help.talend.com/pages/viewpage.action?pageId=19426390
https://help.talend.com/pages/viewpage.action?pageId=19426977#Raa97258
For a talend project, we usually have a generic strategy about stats&logs, that we define in project setting (log in file or db)
for unit test, we temporarily switch to local setting and write in console for checking some infos.
but it's different way to do the some things catch information about logs, stats & meter data.
Because component catcher have fixed schema  to be use by AMC (activity monitoring center ... a graphic interface),
We use tLogCatcher (and other catcher) only to write & aggregate more information.
hope it help
Done some webinar & training about those features , play with them to understand how they work ... Smiley Wink
regards
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

Thanks much for help, marked post as resolved.
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

Hi,
I have created a Talend Job using toracleinput and tjasperoutput components. My job ran successfully without any errors when I ran the job in Talend tool but when I convert to jar file and run in server, I end up with the below exception, and the exact exception is not getting catched. I have used tlogcatcher to catch the java exceptions. Can anybody help me on this.
Community Manager

Re: [resolved] tLogCatcher does not catch Java Exception

Hi 
I see this topic has been marked as resolved. I think you have resolved the issue, feel free to reopen it if you still have any troubles. 
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tLogCatcher does not catch Java Exception

Hi Talend Team,
I have a job and I put tWarn and tDie in typical steps and put tLogcatecher and route its output to tFileoutputdelimited.
But after run the job outfile contains one row which "this is a warning" it doesn't capture all warning logs and die logs.
Please help me on this.