Nullpointer exception when using variable in tRestClient

Highlighted
Seven Stars

Nullpointer exception when using variable in tRestClient

Hello Talend Community

 

I am attempting the following. 

Read from database, create variable, use variable in a REST service parameter for execution. 

Attached is my job details and error.

 

When I change the variable from ((String)globalMap.get("row2.address")) to static "1", everything works fine

 

Job Steps:

tMysqlInput--(Main)->tFlowToIterate--(Iterate)--->tFixedFlowInput--(Main)-->TRESTClient--->tLogRow

 

I have looked at this thread (https://www.talendforge.org/forum/viewtopic.php?pid=140765#p140765) but the steps also leads to the same resultconfigRest.PNGerror.PNGjob.PNGJob

 


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: Nullpointer exception when using variable in tRestClient

Hi,

With tFlowToIterate, the default name from global variables is based on input flow, not output flow.

So, replace "row2.address" by "row1.address" and try again.


TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Nullpointer exception when using variable in tRestClient

Hi,

With tFlowToIterate, the default name from global variables is based on input flow, not output flow.

So, replace "row2.address" by "row1.address" and try again.


TRF
Seven Stars

Re: Nullpointer exception when using variable in tRestClient

Thanks TRF

 

Worked like a charm!!

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

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read