Exception in component tRESTClient_1 - javax.ws.rs.BadRequestException: HTTP 400 Bad Request

Six Stars

Exception in component tRESTClient_1 - javax.ws.rs.BadRequestException: HTTP 400 Bad Request

Hello Talendians,

 

I have a talend job which pulls data from an api and loads into SQL Server. I am constantly running into this error message for the last few days:

 

[FATAL]: SR_Reservation_Extract - tRunJob_1 Child job returns 1. It doesn't terminate normally.
Exception in component tRESTClient_1 (SR_Reservation_API_Child)
javax.ws.rs.BadRequestException: HTTP 400 Bad Request
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:507)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:902)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:863)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:426)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:609)
at tgtimdasevenrooms.sr_reservation_api_child_0_1.SR_Reservation_API_Child.tLoop_1Process(SR_Reservation_API_Child.java:3586)
at tgtimdasevenrooms.sr_reservation_api_child_0_1.SR_Reservation_API_Child.runJobInTOS(SR_Reservation_API_Child.java:10458)

 

I know this a client error and the the server is unable to process the request sent by the client ( Could be invalid syntax) . I tested the api url with query paramaters in POSTMAN and i am seeing the request as successful. It appears there is an issue with how i am making the request in talend job

 

Can someone tell me how i can debug the issue? Any settings i need to change?

 

Thanks.

Eight Stars

Re: Exception in component tRESTClient_1 - javax.ws.rs.BadRequestException: HTTP 400 Bad Request

Hi @desanip ,

 

Can you please print the whole URL, that you are generating in Talend, and then use the full URL in postman/browser and check if you are hitting the correct API.

 

Thanks and Regards,

Subhadip

Six Stars

Re: Exception in component tRESTClient_1 - javax.ws.rs.BadRequestException: HTTP 400 Bad Request

Hi @subhadip13 ,

 

Yes i did print out the full url and i was able to successfully make a request to the api url in postman. I can see the data as well.  My HTTP method is GET and Accept type is XML if i have to be more specific. 

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

Talend Cloud Developer Series – Deploying First Job to Cloud

This video will show you how to run a job in Studio and then publish that job to Talend Cloud

Watch Now

Talend Cloud Developer Series – Fetching Studio License

This video will help someone new to using Talend Studio get started by connecting to Talend Cloud and fetching the Studio License

Watch Now

Talend Cloud Developer Series - Introduction

The Talend Cloud Developer Series was created to give you a solid foundational understanding of Talend’s Cloud Integration Platform

Watch Now