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.PNGJobJob

 


Accepted Solutions
Highlighted
Sixteen Stars
Sixteen 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

View solution in original post


All Replies
Highlighted
Sixteen Stars
Sixteen 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

View solution in original post

Highlighted
Seven Stars

Re: Nullpointer exception when using variable in tRestClient

Thanks TRF

 

Worked like a charm!!

2019 GARTNER 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

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

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog