Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Exception in component tRESTClient_1 java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object;

Hi,

 

I am facing an error while calling an api link from trestclient_1 component, dont know what is going wrong also i need this output in jason format.

 

Attached two files

1st file shows trestclient component configuration

2nd file shows the error

3rd file shows my job design

 

 

Thanks in advance,

Your help is appreciated !!!

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The format does not matter with JSON. It is just a data structure. While it is easier for humans to read when structured in a pretty way, it makes absolutely no difference to computers. Why do you need it in a nice format? 

View solution in original post

10 Replies
Anonymous
Not applicable
Author

I think you will need to give us more information to solve this. We will need to be able to see the URL, especially if there are path params. We will also need to see the API docs if possible. I also note that you have an empty query param (two empty Strings) configured. Is that empty because you have removed those values or was it there when you got the error and shouldn't be included? If that is the case, try removing it.

Anonymous
Not applicable
Author

hi rhall,

Thanks for quick response,

 

Please see the snap with url in attached file, and about query param i havent included any param in that query param they were empty from initial stage.

 

What will be the parameter in that query param (name-value) pair according to that api link or it will remain blank.

 

thanks,

Anonymous
Not applicable
Author

hi rhall,

 

attached is the file.

 

thanks


Capture4.PNG
Anonymous
Not applicable
Author

Can you try removing the empty row in the Query Parameters box? It just holds empty Strings. Doing this will not necessarily fix the issue, but it might change the error.

Anonymous
Not applicable
Author

Hi rhall,

 

I removed that empty row from query parameter box and it worked like a charm, attached is the output which i got on the run console.

 

But the output is not in required format, how can i get the output in jason format.

 

Thanks 


Capture5.PNG
Anonymous
Not applicable
Author

 

Should i use textractjasonfields component to get the output in jason format ?

 

 

Anonymous
Not applicable
Author

Hi @Talendcrazy_18,

 

The output in the screenshot is in JSON format. It is not nicely presented, but it looks like valid JSON. What is wrong with the output from your point of view?

 

Regards

 

Richard

Anonymous
Not applicable
Author

Hi Richard,

 

I am not able to get whats wrong with output format, i have attached two screenshots of trestclient component configuration do i need to make some changes there in component itself to get in nice format.

 

one of Basic settings and second Advance settings.


Capture6.PNG
Capture7.PNG
Anonymous
Not applicable
Author

The format does not matter with JSON. It is just a data structure. While it is easier for humans to read when structured in a pretty way, it makes absolutely no difference to computers. Why do you need it in a nice format?