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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use tDie, tSendMail & log errors into a file

Hi,
I am trying to create a process to copy new incoming data from MySQL to Oracle. I want to be able to stop the process if errors occur; send an email to the administrator and log the errors into a file.
Below is my process I am trying to define, however, I encountered the following problems for the tDie:
==> If this component has output, there must be an input link to propagate the data
tMySQLInput --> Main --> tMap --> Main --> tOracleInput
| |
OnComponentError OnComponentError
| |
tDie --> Main --> tSendMail tDie --> Main --> tSendMail
tlogCatcher --> Main --> tFileOutputDelimited
In addition, will the "tlogCatcher --> Main --> tfileOutputDelimited" flow logs the errors into a file? If not, how should I define the flow in order to log the errors in a log file?
Any help is appreciated? Thanks in advance!
Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hello
In addition, will the "tlogCatcher --> Main --> tfileOutputDelimited" flow logs the errors into a file? If not, how should I define the flow in order to log the errors in a log file?

Yes, once tDie is fired, the tLogCatcher will catch the message define on tDie and log them into a file/db.
Your job looks like:
tMySQLInput --> Main --> tMap --> Main --> tOracleOutput
| |
OnComponentError OnComponentError
| |
tSendMail--onComponentOK--tDie tSendMail---oncomponentok--> tDie
Best regards
shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for your help! I am wondering is there any ways to log tmap if tmap has an error?
Best Regards!
Anonymous
Not applicable
Author

Hello
I am wondering is there any ways to log tmap if tmap has an error?

Yes, tlogCatcher catch all the runtime exception occurs on any a component.
Best regards

shong
Anonymous
Not applicable
Author

Hi Shong,
I encountered an error in the tmap with the following messages:
Starting job JOB_ERROR_LOG at 18:32 03/02/2010.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from long to BigDecimal
at test_log_n_error.job_error_log_0_1.JOB_ERROR_LOG.tMysqlInput_1Process(JOB_ERROR_LOG.java:2330)
at test_log_n_error.job_error_log_0_1.JOB_ERROR_LOG.runJobInTOS(JOB_ERROR_LOG.java:3276)
at test_log_n_error.job_error_log_0_1.JOB_ERROR_LOG.main(JOB_ERROR_LOG.java:3169)
connecting to socket on port 4155
connected
Job JOB_ERROR_LOG ended at 18:32 03/02/2010.
However, tlogcatcher which suppose to create the logs in an excel file was not updated. Can you please help if I need to create another flow to track tmap error?
Thanks again!
Anonymous
Not applicable
Author

Hello
Exception in thread "main" java.lang.Error: Unresolved compilation problem:

It is a compilation problem, not a runtime exception, the job does't work if there is a compilation error in generated code. First, you should correct the compilation error.
From your error message, we can see it can't now convert from long to BigDecimal, so you need conver to long to BigDelimal like this:
new BigDecimal(row1.columnName)
Best regards
shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for your detailed explanations!
Anonymous
Not applicable
Author

how to catch the exact error thrown by the component?

 

like there are 4 fields defined in a schema and all of them are not null, if a filed doesn't have a value how to say that this particular field in a particular row is not valid using Talend?

 

Also what is the best way to report the error to the consumer of the Job?

 

Only Custom message is possible to return from tDie?

 

Is there any other way of error handling on the component schema validations