0 Replies Latest reply on May 21, 2007 2:58 AM by Deepak Solasa

    Exception while generation the jasper Reports using Seam

    Deepak Solasa Newbie

      Hi
      I am trying to generate jasper reports using seam.for that i have used the following code
      InputStream input = this.getClass().getClassLoader().getResourceAsStream(reportName);
      JasperDesign design = JRXmlLoader.load(input);
      JasperReport report = JasperCompileManager.compileReport(design);
      InitialContext initialContext = new InitialContext();
      DataSource ds = (DataSource) initialContext.lookup("java:/claims");
      conn = ds.getConnection();
      JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);
      String fileName = "D:/downloads/ireport/" + showType;
      OutputStream output = new FileOutputStream(new File(fileName));
      JasperExportManager.exportReportToPdfStream(print, output);
      FileInputStream fis = new FileInputStream(fileName);
      BufferedInputStream bis = new BufferedInputStream(fis);
      DataInputStream dis = new DataInputStream(bis);

      and when i tried to rum i am getting the following exception as
      12:18:41,966 INFO [JasperReporter] Exceptionnet.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports
      ngine.JRException: Class "net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory" should be compatible with "net.sf.jasperreports.engine.query.JRQue
      ExecuterFactory"

      Then i changed the code i tried it by setting jdt-compiler-4.1.1 .jar to the class path

      FacesContext facesCtx = FacesContext.getCurrentInstance();
      Map parameters = new HashMap();
      InputStream input = this.getClass().getClassLoader().getResourceAsStream(reportName);
      JasperDesign design = JRXmlLoader.load(input);
      JasperReport report = JasperCompileManager.compileReport(design);
      log.info("jasper design is"+design);
      log.info("inputStream is" + input);
      // get a database connection
      InitialContext initialContext = new InitialContext();
      DataSource ds = (DataSource) initialContext.lookup("java:/claims");
      conn = ds.getConnection();
      JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);
      String fileName = "D:/downloads/ireport/" + showType;
      OutputStream output = new FileOutputStream(new File(fileName));
      //System.setProperty("jasper.reports.compiler.class","org.eclipse.jdt.internal.compiler.Compiler");
      //JasperRunManager.runReportToPdfStream(input,facesCtx.getResponseStream(),parameters,conn);
      facesCtx.getResponseStream().flush();
      facesCtx.getResponseStream().close();
      facesCtx.responseComplete();
      String destFileNamePdf = "opencclaimdecission.pdf";

      // create JasperPrint using fillReport() method
      JasperPrint print = JasperFillManager.fillReport(reportName, parameters, conn);
      JasperExportManager.exportReportToPdfFile(print, destFileNamePdf);*/

      Even now i am getting the Exception as

      12:26:30,884 INFO [JasperReporter] Exceptionnet.sf.jasperreports.engine.JRException: Could not instantiate report compiler : net.sf.jasperreports.engine.
      sign.JRJavacCompiler

      So plz help me what s the solution to generate the jasper Reports....NEed to implement in my roject so urgently..

      Thanx in Advance for any type of suggestions