Null pointer exception in tFileOutputDelimited component

Eight Stars

Null pointer exception in tFileOutputDelimited component

Hi,

 

I'm trying to use the output stream feature of the tFileOutputDelimited component and send the output to tDropboxPut without saving the file to a local directory. my job works fine if I disable 'use output stream' and save the output to my local directory. If I enable 'use output stream',then I get the following error. 

 

Exception in component tFileOutputDelimited_1 (job_Extract_000_db2ToSilverpop)

java.lang.NullPointerException

at java.io.Writer.<init>(Writer.java:88)

at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:97)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.tDBInput_1Process(job_Extract_000_db2ToSilverpop.java:1686)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.tDropboxConnection_1Process(job_Extract_000_db2ToSilverpop.java:893)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.tDBConnection_1Process(job_Extract_000_db2ToSilverpop.java:753)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.tPrejob_1Process(job_Extract_000_db2ToSilverpop.java:518)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.runJobInTOS(job_Extract_000_db2ToSilverpop.java:3432)

at marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop.main(job_Extract_000_db2ToSilverpop.java:3260)

[FATAL]: marketing_campaignextract.job_extract_000_db2tosilverpop_0_1.job_Extract_000_db2ToSilverpop - tFileOutputDelimited_1 null

 

some background about the job:

  • I get data from db2 database (2 columns of type graphic and vargraphic) and converting it into  string in the tMap.
  • I have a user defined routine for email validation and filter in records that have the proper email format in the tFilterrow component.

 

My input data doesn't have any null values.In the tDropboxPut I've checked 'Upload incoming content as File'

 

Attaching the screenshots of my job.

Please let me know what is wrong here

 

Thanks in advance for your help !!


Accepted Solutions
Highlighted
Forteen Stars

Re: Null pointer exception in tFileOutputDelimited component

@nivedhitha,where are you setting the ((java.io.OutputStream)globalMap.get("excel_output_stream")) ?

since you have not set that value for the able variable,because of that you were getting null pointer exception. please check the below link how to use output stream.

 

https://help.talend.com/reader/KxVIhxtXBBFymmkkWJ~O4Q/orwGOyJ72nAubGeMxRyZ8w

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Eight Stars

Re: Null pointer exception in tFileOutputDelimited component

Hi @xdshi / @vapukov,

 

Can you please help me out with my situation? Let me know if have to provide you with additional details.

Appreciate any inputs from you.

 

 

Thank you

Highlighted
Forteen Stars

Re: Null pointer exception in tFileOutputDelimited component

@nivedhitha,where are you setting the ((java.io.OutputStream)globalMap.get("excel_output_stream")) ?

since you have not set that value for the able variable,because of that you were getting null pointer exception. please check the below link how to use output stream.

 

https://help.talend.com/reader/KxVIhxtXBBFymmkkWJ~O4Q/orwGOyJ72nAubGeMxRyZ8w

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Null pointer exception in tFileOutputDelimited component

Hi @manodwhb,

 

Thanks for your reply. Yeah I realized and got it to work Smiley Happy

 

 

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch