Four Stars

Unauthorized Exception in REST Client

Hi All,
I'm using Talend ESB 6.3 version & trying to pull the data from HP ALM to MongoDB. 

In the my job, I've started from "tMongoDBConnection --> tRESTClient --> tExtractXMLField --> tXMLMap --> tMongoDBOutput".
In the REST Client component throwing Exception "HTTP 401 Unauthorized"
My Exception is :
Exception in component tRESTClient_1 HTTP 401 Unauthorized
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(
at org.apache.cxf.jaxrs.client.WebClient.invoke(
at org.apache.cxf.jaxrs.client.WebClient.get(
at local_project.restjob_0_1.RestJob.tRESTClient_1Process(
at local_project.restjob_0_1.RestJob.tMongoDBConnection_1Process(
at local_project.restjob_0_1.RestJob.runJobInTOS(
at local_project.restjob_0_1.RestJob.main(

How to resolve this issue?

Re: Unauthorized Exception in REST Client

Hi, it most likely means the target service is expecting a username and password, please set it in tRESTClient
Twelve Stars

Re: Unauthorized Exception in REST Client

You need to check - what source REST service description, especial authorisation methods
did You test Your REST API call with Postman or similar tools?