File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Unable to produce JSON response for an arraylist contaning java beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Unable to produce JSON response for an arraylist contaning java beans" Watch "Unable to produce JSON response for an arraylist contaning java beans" New topic
Author

Unable to produce JSON response for an arraylist contaning java beans

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115
Hi,

I am new to web services so trying out the tutorials over the net.
I am using JAX-RS tutorials for myeclipse.
I have created a demo application which successfully produces XML response for a list of entities but the same application if configured to produce JSON response for list of entities it is giving below error.

"A message body writer for Java type, class java.util.ArrayList, and MIME media type, application/json, was not found"

My entity and the web service is as below.

WEB Service



Your help in this regards is appreciated.

Best Regards,
Rakesh Kadulkar

Rakesh Kadulkar
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 394
Should line 34 be?

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115
Great that's solved my problem.
Thank you.

- Rakesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to produce JSON response for an arraylist contaning java beans
 
Similar Threads
Could not resolve a persistence unit corresponding to the persistence-context-ref-name
How to submit JSON data as request body in Apache CXF jax-rs (REST)
StrutsPrepareandExecutefilter error
unable to run restful webserive
spring jdbc and action class