title: Problem with Restful WebService
body: <p>I am working on RestFul Webservice,i have written a small restful service, that returns a json data, here is my code :</p>
  
  <pre><code>@Path("/test")
  </code></pre>
  
  <p>public class TestService {</p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public String sayHello() {
      return "&lt;h6&gt; Hello, Welcome to the world of REST (Plain Text) &lt;/h6&gt;";
  }
  @GET
  @Path("dbdetails")
  @Produces(MediaType.APPLICATION_JSON)
  public Map&lt;String, List&gt; getDBDetails() {
      System.out.println("ramesh kumar ");
      List&lt;ProductCategories&gt; list = new ArrayList&lt;ProductCategories&gt;();
      HashMap&lt;String,List&gt; map = new HashMap&lt;String,List&gt;();
      ProductCategories cat = new ProductCategories();
      cat.setId(1);
      cat.setImage("Image21");
      cat.setName("Electronics");
      cat.setRowid(111);
      cat.setType("CatType");
      list.add(cat);
      map.put("Ramesh",list);
      System.out.println("ramesh kumar ");
      return map;
  
  }
  </code></pre>
  
  <p>But I am getting error :</p>
  
  <blockquote>
    <p>SEVERE: A message body writer for Java type, class java.util.HashMap, and MIME media type, application/json, was not found
    Mar 3, 2011 3:32:41 PM com.sun.jersey.server.impl.application.WebApplicationImpl onException
    SEVERE: Internal server error
    javax.ws.rs.WebApplicationException</p>
  </blockquote>
  
  <p>Any ideas?</p>