Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6387223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:07:27+00:00 2026-05-25T03:07:27+00:00

I have to send a ByteArrayOutputStream through a rest service, and I got this

  • 0

I have to send a ByteArrayOutputStream through a rest service, and I got this exception:

org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/html;charset="iso-8859-1" and type class java.io.ByteArrayOutputStream

I don’t understand why and I have to make it work.

Here is my rest service:

@POST
@Path("/exported")
@Consumes(MediaType.APPLICATION_XML)
public ByteArrayOutputStream getExported(Wrapper wrapper) {

    ByteArrayOutputStream os = null;

    os = new ByteArrayOutputStream();
    try {
        os.write("TTT".getBytes());
    } catch (IOException e) {
        e.printStackTrace();
    }

    return os;

}

Here is my client:

    ClientRequest request = new ClientRequest("http://localhost:8081/restws/rest/rrr/exported");
    request.accept(MediaType.APPLICATION_XML);

    request.body(MediaType.APPLICATION_XML, new Wrapper(
            listOf Objects));

    ClientResponse<ByteArrayOutputStream> response = request
            .post(ByteArrayOutputStream.class);

    ByteArrayOutputStream os = response.getEntity();

    return "success";

Everything in the class containing this method works, except this method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:07:27+00:00Added an answer on May 25, 2026 at 3:07 am

    RestEasy doesn’t know who to convert your ByteArrayOutputStream into something that can be sent over HTTP. Read up on RESTEasy Content Marshalling and then either use a different content type and/or use a different data type that is automatically handled and/or write a content marshalling provider to handle your ByteArrayOutStream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to send .csv file to remote server through REST in rails. I
I have to send a large amount of xml data through sockets. Example of
I have to send a long string of data through webservice to database.I odnt
I have send an attachment through iPhone application. But when I see the mail,
I have set up a UDP client/server model that can send string messages to
I have send data from my HTML page to servlet , this is the
I have to send some text-information from the webserver to the users. Unfortunately, this
Good day, i have a requirement where i need to send files(image/videos.. etc) through
I have to send planned support notification emails on system events (service window, alerts,
I have send an email using php mailer class. mail was sending successfully but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.