tMap error Nullpointerexception

Five Stars

tMap error Nullpointerexception

Hello Guys,

 

I'm new using talend and i tried to create a job who read a excel files and create two outputs at my oracle DB, using a conditional. If the column "Tipo de requisição" is "RNC" go to output1 and if the column "Tipo de requisição" is "CR" go to output2, in the first time i execute this job works well but now stops and give this mensage error

 

Exception in component tMap_16 (Carga_StagingArea)
java.lang.NullPointerException
 at extract_to_oracledb.carga_stagingarea_0_1.Carga_StagingArea.tFileInputExcel_16Process(Carga_StagingArea.java:5877)
 at extract_to_oracledb.carga_stagingarea_0_1.Carga_StagingArea.runJobInTOS(Carga_StagingArea.java:7249)
 at extract_to_oracledb.carga_stagingarea_0_1.Carga_StagingArea.main(Carga_StagingArea.java:7099)

 

The expresion i'm using to filter1 is......... row16.Tipo_de_Requisicao.equals("RNC") 

The expresion i'm using to filter2 is ..........row16.Tipo_de_Requisicao.equals("CR")

 

My input and output is string and if i remove this filters the job works.

 

I will attach some prints.

 

P.S : I don't have null valeus at  "Tipo_de_Requisicao" columnCapture.PNGCapture1.PNGCapture2.PNG

 

 

Fifteen Stars TRF
Fifteen Stars

Re: tMap error Nullpointerexception

This error occurs when a field of the expression is null. Double check your data and reverse thé expression like this:
"RC".equals(row16.Tipo_de_Requisicao)
to avoid null pointer exception

TRF
Five Stars

Re: tMap error Nullpointerexception

I reverse the expression, the error mensage is not showing more, but 0 rows was write in my DB

"RNC".equals(row16.Tipo_de_Requisicao) i put this in my expression
Fifteen Stars TRF
Fifteen Stars

Re: tMap error Nullpointerexception

Try to execute the job with Debug Traces to check if the data are as expected (maybe something wrong in previous mapping or spaces at the end of "Tipo_de_Requisicao" field, ...)


TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog