title: JasperReports: Error loading object from file while compiling report through jsp code
body: <p>I have created a master report and a sub report. I have written the code in jsp to call the master report but it gives an error. </p>
  
  <pre><code>Error Loading object from file: "path where the sub report resides". 
  </code></pre>
  
  <p>Please help me out if I am doing something wrong. </p>
  
  <pre class="lang-java prettyprint-override"><code>jasperdesign = JasperManager.loadXmlDesign(getServletConfig()
          .getServletContext().getRealPath("/reports/VoucherReport.jrxml"));
  jasperReport = JasperCompileManager.compileReport(jasperdesign);
  
  HashMap map = new HashMap();
  map.put("myParam", voucherId);
  
  jasperPrint = JasperFillManager.fillReport(jasperReport, map, con);
  JasperManager.printReportToPdfFile(jasperPrint, getServletConfig()
          .getServletContext().getRealPath("/reports/myReport.pdf"));
  </code></pre>
  
  <p>It is throwing an exception on jasper print. Please help me out. I need a solution for this voucher report is a master report, do I also need to compile subreport too.</p>