Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to show stacktrace on error when running from command-line?

When I run my job from the command-line (using the shell script), is there any way to make it show a stack trace of the error? All I get is:
Exception in component tSystem_1
0683p000009MDaX.png
Labels (2)
16 Replies
Anonymous
Not applicable
Author

Hi,
If you log into studio, there is a error which is located in <Talend Studio install path>/workspace/.metadata/. If not, the error log is kept in <Talend Studio install path>\configuration.

Best regards
Sabrina
Anonymous
Not applicable
Author

Hi. This is not an error when running the job within Talend (ie. through the UI). It's an error when I export the job as a standalone process and run it on its own, outside of Talend.
Anonymous
Not applicable
Author

Hi,
Do you check the location of <Talend Studio install path>\configuration? When you run your job from the command-line (using the shell script).
Best regards
Sabrina
Anonymous
Not applicable
Author

Again, I'm running this on a machine that does NOT have Talend installed on it at all., so there is no <Talend Studio install path>.
I have exported my job with scripts (that Talend generates) and I am running the shell script that Talend created.
Anonymous
Not applicable
Author

Hi,
Run the command line on your machine:
sh test.sh > error.log

Best regards
Sabrina
Anonymous
Not applicable
Author

It seems you still do not understand what I am asking for.
Again, there is no stack trace in the output to stdout, so redirecting it to a log file isn't going to do anything.
My original question was whether there was a way to reconfigure talend so that it would show the stack traces for the exceptions catch by the tLogCatcher. If you can tell me how to do that, then you will have answered my question.
Anonymous
Not applicable
Author

Hello,
Actually i am having the same problem.
I need to check the stack strace of error and even send an email with that error and respective stack trace.
tLogCatcher and tAssertCatcher, apparently, only gives u the error but not the stack strace.
Is there any way to "catch" a java exception with the respective stack strace?
Anonymous
Not applicable
Author

Of course you can.
The tSystem component provides to catch both output streams of a process to get it as global variabale.
You can access the content as string while the job is running and after the job finished. It is necessary to setup the options Standard Output and error Output to: "to global variable"
Here an example (in case your component in the job is the first of tSystem components):
((String) globalMap.get("tSystem_1_OUTPUT")) returns the normal output
((String) globalMap.get("tSystem_1_ERROROUTPUT")) returns the error output content.
You can use the tParallel component to run your job and in parallel to it a different subjob checking the output.
Anonymous
Not applicable
Author

Of course you can.
The tSystem component provides to catch both output streams of a process to get it as global variabale.
You can access the content as string while the job is running and after the job finished. It is necessary to setup the options Standard Output and error Output to: "to global variable"
Here an example (in case your component in the job is the first of tSystem components):
((String) globalMap.get("tSystem_1_OUTPUT")) returns the normal output
((String) globalMap.get("tSystem_1_ERROROUTPUT")) returns the error output content.
You can use the tParallel component to run your job and in parallel to it a different subjob checking the output.

Thank you very much for your reply.
I have a few doubts, hope u can help me:
I can't find the tParallel component (its available on the community edition?)
What do i need to put on the command field of tSystem (if anything)?
So far i have something like this
tLogCatcher->tSendMail (where it sends me an email with the job's name and respective error.)
"All" i want is to get also the stack trace and place it on the message content.
I can't figure where to place the tSystem to be able to place ((String) globalMap.get("tSystem_1_ERROROUTPUT")) on the message field of tSendMail (it keeps giving me null when i receive the email)