Six 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

 

  • Data Integration
  • ESB
1 ACCEPTED SOLUTION

Accepted Solutions
Eleven Stars TRF
Eleven 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
2 REPLIES
Eleven Stars TRF
Eleven 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
Six Stars

Re: Nullpointer exception when using variable in tRestClient

Thanks TRF

 

Worked like a charm!!