Nullpointer exception on tWriteJSONField

Highlighted
Six Stars

Nullpointer exception on tWriteJSONField

Hi, 

Can I please get some fresh eyes debugging on this? I simply want to output a JSON when the tSchemaComplianceCheck rejects input (here when col_1 is null). The tWriteJsonField keeps shouting a NullpointerException like this:

 

Exception in component tWriteJSONField_1_Out (draft)
java.lang.NullPointerException
	at awodoodi.draft_0_1.draft.tFixedFlowInput_1Process(draft.java:3223)
	at awodoodi.draft_0_1.draft.runJobInTOS(draft.java:8179)
	at awodoodi.draft_0_1.draft.main(draft.java:6256)

Screenshot from 2019-01-11 11-51-58.png

Screenshot from 2019-01-11 11-57-02.pngScreenshot from 2019-01-11 11-53-47.png

Tags (1)

Accepted Solutions
Six Stars

Re: Nullpointer exception on tWriteJSONField

I see. Really strange, though. Why would a component raise an exception even if its own schema is correct? As shown in the screenshot below, the tWriteJSONField has only a single nullable column. 

 

Screenshot from 2019-01-11 15-36-35.pngAnyway, thanks for your answer @vapukov. I think I will replace this tSchemaComplianceCheck with a good old tJava where I can make advanced data validation, and keep the tMap for two output flows (valid/invalid)

 


All Replies
Thirteen Stars

Re: Nullpointer exception on tWriteJSONField

it interesting issue

from tSchemaComplianceCheck your output schema contains one not null column - it is exactly column which is null and rejected

 

and this NULL value - give error for tWriteJSON, because it expect not null value in this column (not important do you use it or not)

 

you can install tMap between and in tMap make it nullable

Screen Shot 2019-01-12 at 1.26.55 AM.png

 

Screen Shot 2019-01-12 at 1.26.47 AM.png

 

-----------
Six Stars

Re: Nullpointer exception on tWriteJSONField

I see. Really strange, though. Why would a component raise an exception even if its own schema is correct? As shown in the screenshot below, the tWriteJSONField has only a single nullable column. 

 

Screenshot from 2019-01-11 15-36-35.pngAnyway, thanks for your answer @vapukov. I think I will replace this tSchemaComplianceCheck with a good old tJava where I can make advanced data validation, and keep the tMap for two output flows (valid/invalid)

 

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.