title: SEVERE: A message body writer for Java class java.util.ArrayList and MIME media type application/json was not found
body: <p>I am testing RESTful services and when I execute I am getting exceptions although I have the following jars in my class path(WEB-INF/lib), I am not using Maven and my JDK version is 1.5. Other questions regarding this issue didn't help to resolve the problem.</p>
  
  <p>Code snippet</p>
  
  <pre><code>@GET
  @Produces("application/json")    
  //@Produces({MediaType.APPLICATION_JSON}) tried this, didn't work either
  public List&lt;Emp&gt; getEmployees() {        
      List&lt;Emp&gt; empList = myDAO.getAllEmployees();
      log.info("size   " + empList.size());
      return empList;
  }
  
  @XmlRootElement
  public class Emp {
  ......
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
          &lt;param-value&gt;test.employees&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  
   &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p><strong>List of jars</strong></p>
  
  <pre><code>jersey-server-1.2.jar
  jersey-core-1.2.jar
  jsr311-api-1.1.jar
  asm-3.1.jar
  jaxb-api-2.0.jar
  jaxb-impl-2.0.jar
  jackson-xc-1.2.0.jar
  jackson-jaxrs-1.2.0.jar
  jackson-mapper-asl-1.2.0.jar
  jackson-core-asl-1.2.0.jar
  jettison-1.2.jar
  jersey-client-1.2.jar
  jersey-servlet-1.10.jar
  jersey-json-1.8.jar
  </code></pre>
  
  <p><strong>Exception stack</strong></p>
  
  <pre><code> SEVERE: A message body writer for Java class java.util.ArrayList,
   and Java type java.util.List&lt;test.Emp&gt;, 
   and MIME media type application/json was not found
  Nov 21, 2013 11:47:26 AM com.sun.jersey.spi.container.ContainerResponse traceException
  SEVERE: Mapped exception to response: 500 (Internal Server Error)
  
  javax.ws.rs.WebApplicationException
      at javax.ws.rs.WebApplicationException.&lt;init&gt;(WebApplicationException.java:97)
      at javax.ws.rs.WebApplicationException.&lt;init&gt;(WebApplicationException.java:55)
      at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:267)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1035)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:947)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:939)
      at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:399)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:478)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:663)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
      at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
      at java.lang.Thread.run(Thread.java:595)
  </code></pre>
  
  <p>How can I resolve this issue?</p>