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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tstatscatcher

Hi,
I am trying to load jobname,Job execution time,job Stauts in database table using tstatscatcher along with some other values. Flow for loading these details shown below:
0683p000009MFI2.png
coding of tjavarow:

try {

if(input_row.pid.equals(null))
output_row.pid = null;
else
output_row.pid = StringHandling.BTRIM(input_row.pid);

if (Relational.ISNULL(input_row.moment))
output_row.moment = null;
else
output_row.moment = input_row.moment;

if (Relational.ISNULL(input_row.job))
output_row.job = "notnull";
else
output_row.job = input_row.job;

if (Relational.ISNULL(input_row.message))
output_row.message = "notnull";
else
output_row.message = input_row.message;

if (Relational.ISNULL(input_row.duration))
 output_row.duration =  0L;
else
output_row.duration = input_row.duration;

if (Relational.ISNULL((Integer) globalMap.get("tMSSqlOutput_2_NB_LINE_INSERTED")))
output_row.Target_row_count = 0;
else
output_row.Target_row_count = (Integer) globalMap.get("tMSSqlOutput_2_NB_LINE_INSERTED");

if (Relational.ISNULL((Integer) globalMap.get("tCassandraInput_2_NB_LINE")))
output_row.src_row_count = 0;
else
output_row.src_row_count = (Integer) globalMap.get("tCassandraInput_2_NB_LINE");

if (Relational.ISNULL((Integer) globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED")))
output_row.reject_row_count = 0;
else
output_row.reject_row_count = (Integer) globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED");

if (Relational.ISNULL(context.batch_Id))
output_row.batch_Id = 0;
else
output_row.batch_Id = context.batch_Id;

} catch (Exception e)
 {
  System.out.println("Null value");
 }

While runing this job, I am getting below error but rows are getting inserted in target table with job status as failure.

Error:

[statistics] connecting to socket on port 4064
[statistics] connected
Exception in component tMSSqlOutput_5
java.lang.NullPointerException
at rsa_dev.job_vault2_ent_ev_agcy_new_0_1.job_Vault2_Ent_Ev_Agcy_New.tStatCatcher_1Process(job_Vault2_Ent_Ev_Agcy_New.java:9656)
at rsa_dev.job_vault2_ent_ev_agcy_new_0_1.job_Vault2_Ent_Ev_Agcy_New.runJobInTOS(job_Vault2_Ent_Ev_Agcy_New.java:10649)
at rsa_dev.job_vault2_ent_ev_agcy_new_0_1.job_Vault2_Ent_Ev_Agcy_New.main(job_Vault2_Ent_Ev_Agcy_New.java:10258)
[FATAL]: rsa_dev.job_vault2_ent_ev_agcy_new_0_1.job_Vault2_Ent_Ev_Agcy_New - tMSSqlOutput_5 null
[WARN ]: com.datastax.driver.core.FrameCompressor - Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression will not be available for the protocol.
[WARN ]: com.datastax.driver.core.FrameCompressor - Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol.
[statistics] disconnected
Job job_Vault2_Ent_Ev_Agcy_New ended at 14:15 18/05/2016. [exit code=1]

Also, I tried loading this output into excel file instead of table and loading table from this excel, its giving same error.

Data in excel file is below:
0683p000009MFIk.png


Could anyone please tell me, why I am getting null pointer exception error and its solution.

Is there exist any global variable contain value of job execution time, job status?

Thanks in Advance! 

Pradanya

Labels (2)
2 Replies
Anonymous
Not applicable
Author

likely something in your tMSSqlOutput is null when it shouldnt be 

if youre using context to store connection parameters check if those are null. If you've got "use existing connection" checked and dont have a tMSSqlConnection component in the job this can also cause the issue. 
Anonymous
Not applicable
Author

Thanks John. Null Pointer error got resloved.
I have attached tMSSqlConnection, but table was not able to read from connection.
When I hard coded connection parameter,it worked. 0683p000009MACn.png