Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
user19
Contributor
Contributor

Rest route throwing error java.io.IOException: stream is closed

I am creating a Rest Route. It is a simple route which takes Request and get the response from endpoint which is located on Swagger. I have used build in Meta Data Rest API definition to add my Api. Now when I am trying to call the Endpoint using Soap UI it throws Error java.io.IOException: stream is closed. Idon't understand what is the reason behind this error. Following screenshot contain full trace of Error.

0695b00000PMSXgAAP.png 

Can some one please guide me What is wrong why I am getting this error? Any help would be appreciated.

 

Edited:

Before I didn't added the response class "javax.ws.rs.core.Response" in tRest-2 now after adding class I got this error

Labels (3)
13 Replies
Anonymous
Not applicable

In v7.3 Java 11 is recommended (https://help.talend.com/r/en-US/7.3/installation-guide-open-studio-for-esb-mac/compatible-java-environments).

 

I have just tried to emulate your experience here and was able to do so. I then played around and replaced the second cRest with a cHttp component set up as client rather than server. It worked. Can you give that a go?

user19
Contributor
Contributor
Author

 

Hello,

thank you for the response. I replaced it with cHHTp and it throw following error.

I am creating an existing service so do you think should I add some other component?

 

0695b00000PMTysAAH.png0695b00000PMTynAAH.png

Anonymous
Not applicable

Unfortunately it can be quite difficult to work on services when you have no access to them yourself. I had to recreate a similar environment to what you showed and try a few things out. I realised that in my scenario, I could use a cHttp component (to replace the second cREST), so tried it and it worked. The Endpoint was created exactly the same way.

 

I have done a bit of Googling about this issue. These are Apache Camel components, so it is always good to search for answers in that domain as well. It turns out that the marshalling of incoming data can cause a similar issue. So I ticked the "Skip incoming data unmarshalling" tickbox on the second cREST component (which I've added back). This appears to solve it for me as well.

user19
Contributor
Contributor
Author

@Richard Hall​ thanks it really worked.