Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
navds
Creator II
Creator II

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)

0683p000009M1l7.png

0683p000009M1Gj.png0683p000009M1u3.png

Labels (3)
1 Solution

Accepted Solutions
navds
Creator II
Creator II
Author

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. 

 

0683p000009M1uD.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)

 

View solution in original post

2 Replies
vapukov
Master II
Master II

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

0683p000009M1u8.png

 

0683p000009M1qR.png

 

navds
Creator II
Creator II
Author

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. 

 

0683p000009M1uD.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)