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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:44:26+00:00 2026-06-05T04:44:26+00:00

I am trying to implement a RESTful service endpoint which produces XML responses. The

  • 0

I am trying to implement a RESTful service endpoint which produces XML responses. The return entity for this service call is a HashMap which has the data for the output to be generated. But I keep getting the following exception while invoking the service:

HttpMediaTypeNotAcceptableException: Could not find acceptable
representation

To investigate the issue, I wrote another endpoint which produces a response for a single object (say, Employee). I have annotated this class with @XmlRootElement and invoking it works just fine. If I remove the @XmlRootElement annotation from the Employee class, this endpoint will also fail and give the same exception which I mentioned above.

As per my understanding the root object in the ResponseEntity should be annotated with @XmlRootElement. My problem centers around how to use this annotation on collections like Map, List etc..

All help appreciated, thanks.

  • 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-05T04:44:27+00:00Added an answer on June 5, 2026 at 4:44 am

    I don’t think this is possible — you will most likely have to create some sort of wrapper or DTO around your Collection/Map. This: Using JAXB to unmarshal/marshal a List<String> I believe is related to your use-case.

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

Sidebar

Related Questions

I am trying to implement a RESTful API in which I have to upload
Background I am trying to implement a RESTful web service using Apache-CXF that interacts
I'm trying to implement a RESTful Service in Java that receives a JSON Object
I have been trying to find a way to implement a RESTful web service
I'm trying to make a RESTful Web Service which implements all four CRUD operations.
I am trying to write a C# restful web service which returns the customer
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
Trying to implement a search similar to here .This searches properties based on city,locality,property
I have a module Api where I am trying to implement a RESTful API.

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.