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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:07:25+00:00 2026-06-01T11:07:25+00:00

The error I receive: SEVERE: A message body reader for Java class java.util.List, and

  • 0

The error I receive:

SEVERE: A message body reader for Java class java.util.List, 
and Java type java.util.List<com.testapp.Category>, 
and MIME media type text/html; charset=utf-8 was not found

Trying to consume a JSON response from a Rest service using the GET method with Jersey. The response from the server looks like this when I use curl:

[{"category":{"id":"4d9c5dfc8ddfd90828000002","description":"Cows"}},
{"category":{"id":"4d9c5dfc8ddfd90828000023","description":"Dogs"}},
...
{"category":{"id":"4d9c5dfc8ddfd90828000024","description":"Mules"}}]

Consuming the service with:

public List<Category> getAnimalCategories(Cookie cookie) {
    Client client = Client.create(new DefaultClientConfig());
    ClientResponse response = client
        .resource(Constants.BASE_URL)
        .path(Constants.CATEGORIES_ANIMALS)
        .accept(MediaType.APPLICATION_JSON)
        .type(MediaType.APPLICATION_JSON)
        .cookie(cookie)
        .get(ClientResponse.class);

    return response.getEntity(new GenericType<List<Category>>(){});
}

Where Category.java is:

public class Category {

public String id;
public String description;

public Category() {
}

public Category(String id, String description) {
    super();
    this.id = id;
    this.description = description;
}

The service uses cookie based authentication – that part works and I have other service calls working with the cookie.

  • 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-01T11:07:27+00:00Added an answer on June 1, 2026 at 11:07 am

    Used the Jackson 1.9.6 lib to resolve the issue – see the 2nd line below:

    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getClasses().add(JacksonJsonProvider.class);
    Client client = Client.create(clientConfig);
    
    return client
        .resource(Constants.BASE_URL)
        .path(Constants.CATEGORIES_ANIMALS)
        .type(MediaType.APPLICATION_JSON)
        .accept(MediaType.APPLICATION_JSON)
        .cookie(cookie)
        .get(new GenericType<List<AnimalCategoryResponse>>(){});
    

    Also needed to use a new response class:

    public class AnimalCategoryResponse {
        public Category[] category;
        public AnimalCategoryReponse() { }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML reader but I receive an error when I'm trying to
Why i receive error? the class in the same namespace.. php 5.3.0 namespace ExampleSystem\Core;
Why do i receive error in the following declaration ? List<int> intrs = new
I create this function in a class and I receive error: pointer to incomplete
autocmd VimEnter * if filereadable('cctree.out') | CCTreeLoadXRefDBFromDisk cctree.out | endif I receive error message:
I am trying to configure NTLM authentication, but receive error: cvc-complex-type.2.4.c: The matching wildcard
I'd like to receive error logs via email. For example, if a Warning-level error
I receive the error below when running the following function. The catch says the
When I run cake bake all then I receive the error messages shown below.
I'm trying to plotting a function but I receive an error and since I'm

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.