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

  • Home
  • SEARCH
  • 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 7248893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:12:11+00:00 2026-05-28T22:12:11+00:00

I need to return a list of objects from a restful webservice. each object

  • 0

I need to return a list of objects from a restful webservice. each object is a row of database table data.

This is my restfulwebservice

@GET
@Consumes("text/html")
@Produces(MediaType.MULTIPART_FORM_DATA)
public ArrayList<FetchDatabase> fetchFromDatabse(){
return new CouponSetup().fetchFromDatabse();
}

FetchDatabase is a bean. I got the required resultset size after the fetch

when i try to call this webservice am getting an error Status 500 Internal server error and the following in the console

A message body writer for Java class java.util.ArrayList, and Java type java.util.Collection, and MIME media type multipart/formdata was not found

I have tried commenting the @produces annotation still the same error with MIME media type application/octet-stream

I have read that we need to convert the list to XML or json and retrieve it later

Is there any alternate way?If not can u help me parsing the object into XML/JSON and retrieving later in JAVASCRIPT

Can anyone help in a method to iterate through the object here JSONArray and form a table from it
I am using Tomcat 7.0.22 server and jersey RS 1.11

  • 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-28T22:12:12+00:00Added an answer on May 28, 2026 at 10:12 pm

    Tried using the above method, but converting the JSONArray back to list was tiresome. so i converted each list object to a json and added to the JSONArray and returned the JSONarray. In the client side, i iterated through the Array and retrieved details from each JSON object.

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

Sidebar

Related Questions

I need to return server time from a webservice. I've got the following code:
I need some help in using objects from Core Data with GCD; I seem
I need to return/update a boolean while returning a list of stuff from a
I'm using SimpleJdbcTemplate to fetch a list of records from a database. Each record
I need to return an array of initialized objects from VB6 into C# using
I need to return a list of counties, but I need to filter out
i need to return a JSON with this format: {answers: [{id: 93, value:Ahstron}, {id=94,
I need to return a full directory name from inside a specified directory that
I need to return multiple values from a ColdFusion function in an ajax callback
I need to return two values at a time, so I have: class IterableObject(object):

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.