REST Component exception java.lang.IllegalArgumentException: Illegal

One Star lkv
One Star

REST Component exception java.lang.IllegalArgumentException: Illegal

I am trying to use the REST component by having Global variable in the URL and getting this error.
REST is having the below URL as in the screen shot.

The java node is having this below line:
System.out.println("The Webervice Token is  :" +(String)globalMap.get("token_result"));

what i am doing is trying to attach the "Token" global variable into the URL, but when i run i am getting is below error
connecting to socket on port 3761
The Webervice Token is  :token=ws31aeb9bdb40ee71b3a:a877881:14fcccd3d12:2c330.16576409984069873
Exception in component tREST_2
java.lang.IllegalArgumentException: Illegal character in query at index 150: https://dev-acm-suse/aveksa/command.submit?cmd=createChangeRequest&token=ws31aeb9bdb40ee71b3a:a87788...

    at Source)
    at com.sun.jersey.api.client.Client.resource(
    at zions_etl.aveksa_webservice_termination_0_1.Aveksa_WebService_Termination.tREST_2Process(
    at zions_etl.aveksa_webservice_termination_0_1.Aveksa_WebService_Termination.tREST_1Process(
    at zions_etl.aveksa_webservice_termination_0_1.Aveksa_WebService_Termination.tSetKeystore_1Process(
    at zions_etl.aveksa_webservice_termination_0_1.Aveksa_WebService_Termination.runJobInTOS(
    at zions_etl.aveksa_webservice_termination_0_1.Aveksa_WebService_Termination.main(
Caused by: Illegal character in query at index 150: https://dev-acm-suse.zbc.internal/aveksa/command.submit?cmd=createChangeRequest&token=ws31aeb9bdb40e...

    at$ Source)
    at$Parser.checkChars(Unknown Source)
    at$Parser.parseHierarchical(Unknown Source)
    at$Parser.parse(Unknown Source)
    at<init>(Unknown Source)
    ... 7 more
Job Aveksa_WebService_Termination ended at 12:35 17/09/2015.

This is throwing this error only when i have the Globalvar in the REST URL.
when i have the full URL as below in the REST component with out having to pass the Global variable then it works fine.
Any idea why it is throwing this error?
Community Manager

Re: REST Component exception java.lang.IllegalArgumentException: Illegal

Have a try to build the full url with a context variable on tJavaRow:
and set the URL field of tRest2 with the context variable.
Please let me know if it works?
Best regards
Talend | Data Agility for Modern Business