title: No serializer found error on java restfull web service
body: <p>I have created a json array like this </p>
  
  <pre><code>[
    {
      "proj_bugcount":"20",
      "pro_id":"1",
      "proj_status":"bugs",
      "pro_name":"Driver MAnagement System"
    },
    {
      "proj_bugcount":"0",
      "pro_id":"3",
      "proj_status":"released",
      "pro_name":"Hotel MAnagement System"
    }
  ]
  </code></pre>
  
  <p>by using below code</p>
  
  <pre><code>package com.test.databaseservice;
  
  import com.test.entity.DashBoard;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.ResultSetMetaData;
  import java.sql.SQLException;
  import java.util.ArrayList;
  import java.util.List;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  public class DashboardService {
  
      public static List&lt;JSONObject&gt; findRelatedData(int userId) throws JSONException {
  
          String setBugCount = null;
          String proId = null;
          String setProject = null;
          String setStatus = null;
  
          DashBoard dashboard = new DashBoard();
          List&lt;JSONObject&gt; resList = new ArrayList&lt;JSONObject&gt;();
  
          try {
              Class.forName("com.mysql.jdbc.Driver");
          } catch (ClassNotFoundException e) {
              System.out.println(e);
          }
  
          try {
  
              Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/project_management_system", "root", "");
  
              PreparedStatement ps = con.prepareStatement("SELECT project.proj_status,project.Pro_Name,project.proj_bugcount,project.Pro_Id FROM project_details INNER JOIN project ON project_details.Pro_Id = project.Pro_Id WHERE emp_id = ?");
  
              ps.setInt(1, userId);
              ResultSet rs = ps.executeQuery();
  
  
              ResultSetMetaData rsMeta = rs.getMetaData();
              int columnCnt = rsMeta.getColumnCount();
  
              ArrayList&lt;String&gt; columnNames = new ArrayList&lt;String&gt;();
              for (int i = 1; i &lt; columnCnt + 1; i++) {
  
                  columnNames.add(rsMeta.getColumnName(i).toLowerCase());
  
              }
              while (rs.next()) {
                  JSONObject obj = new JSONObject();
  
                  for (int a = 1; a &lt; columnCnt + 1; a++) {
  
                      String key = columnNames.get(a - 1);
                      String value = rs.getString(a);
                      obj.put(key, value);
  
                  }
                  resList.add(obj);
              }
              con.close();
  
          } catch (SQLException e) {
              System.out.println(e);
          }
  
  
          return resList;
      }
  }
  </code></pre>
  
  <p>Then I passed it to the below web service</p>
  
  <pre><code>package com.test.rest;
  
  import com.test.databaseservice.DashboardService;
  import java.util.ArrayList;
  import java.util.List;
  import javax.ws.rs.Consumes;
  import javax.ws.rs.Produces;
  import javax.ws.rs.GET;
  import javax.ws.rs.Path;
  import javax.ws.rs.PathParam;
  import javax.ws.rs.core.MediaType;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  @Path("dashboard")
  public class DashBoardRestServices {
  
      @Path("find/{userName}")
      @GET
      @Consumes({MediaType.APPLICATION_JSON})
      @Produces(MediaType.APPLICATION_JSON)
      public List&lt;JSONObject&gt; find(@PathParam("userName") int userName) throws JSONException{
          //Find Employee from the database with give Id
          //DashBoard dashboard = new DashBoard();
          DashboardService Dashboardservice = new DashboardService();
  
          List&lt;JSONObject&gt; resList = Dashboardservice.findRelatedData(userName);
          System.out.println(resList);
  
          return resList;
  
      }
  
  }
  </code></pre>
  
  <p>the system.out.println outputs the created array correctly.</p>
  
  <p>But when I navigated to the webservice Url it shows below Error</p>
  
  <pre><code>    No serializer found for class org.json.JSONObject and no properties discovered to create BeanSerializer (to avoid exception,
  disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.ArrayList[0])
  </code></pre>
  
  <p>What is the issue there?</p>