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 7909761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:35:12+00:00 2026-06-03T12:35:12+00:00

I am trying to send a generic list to a jersey servlet using put

  • 0

I am trying to send a generic list to a jersey servlet using put method, using GenericEntity. I have seen a lot of examples requesting a generic list, but none of them putting it.

So the code on my server is:

@PUT
@Produces(MediaType.TEXT_HTML)
public String doPutHtml(GenericType<List<SystemInfo>> systemInfoList) {
    System.out.println(systemInfoList.toString());
    return "OK";
}

And the code on the client sending the put request:

WebResource ws;
Configuration conf = ConfigurationFactory.getConfigurationFactory()
            .getConfiguration();

Client client = Client.create();
ws = client.resource("http://" + conf.getDatacenterURL() + ":"+ conf.getDatacenterPort() + "/services/systemInfo");
GenericEntity entity = new GenericEntity<List<SystemInfo>>(systemInfoList) {};
String response = ws.accept(MediaType.TEXT_HTML).type(MediaType.APPLICATION_XML).put(String.class, entity);

When I run the client code, I get this exception:

com.sun.jersey.api.client.ClientHandlerException: com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class java.util.ArrayList, and MIME media type, application/octet-stream, was not found

So my question would be, is it possible to send a generic list this way? In case this is not possible, are there any alternatives?

  • 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-06-03T12:35:17+00:00Added an answer on June 3, 2026 at 12:35 pm

    This issue is generated during marshaling and marshaling the objects.There is a similar thread here which talks about the same issue.However, that is related to JAXB.There too, it tries to serialize a list object and faces the same issue.Once you analyze the issue, it is easy to implement the same technique here as well.

    Using JAXB to unmarshal/marshal a List<String>

    Hope this will help you.

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

Sidebar

Related Questions

I'm trying to send a byte[] (using PUT) with Restlet but I can't find
Im trying to send a List of Items with generic Keys and Value Types
what I'm trying to do is send a generic method(filter) inside generic object(ItemDelegate) to
Trying to send a complex type between two systems that have the same code
im trying to send rest api Users.getLoggedInUser i have all the secret session and
I am trying to send email using Exchange 2007 from a console app using
I'm trying to send a SOAP request using SOAPpy as the client. I've found
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
I'm trying to write some reasonably generic networking code. I have several kinds of
On Android, I am trying to send a custom broadcast message using a custom

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.