title: HTTP Status 406 – Not Acceptable in spring MVC Rest Service
body: <p>Here is my code :</p>
  
  <pre><code>@RequestMapping(value = "/report/download", method = RequestMethod.GET,produces="application/vnd.ms-excel")
      public Response getReportFile(@QueryParam("reportid") Long reportId)
      {
          System.out.println("Param"+reportId);
          Long n=(long) 10;
          String json=reportService.getReportFile(n);
          File file = new File("D:\\Agent Information.xls");  
          ResponseBuilder response = Response.ok((Object) file);  
          response.header("Content-Disposition","attachment; filename=Sample.xls");  
          return response.build();  
      }
  </code></pre>
  
  <p>i am getting the below Error in java console: Handler execution resulted in exception: Could not find acceptable representation</p>