• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JasperFillManager - class not found problem

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to create a CSV report using Jasper.
The following code create a report as desired.
The problem is using it several time in a roll the following Error - "Caused by: java.lang.ClassNotFoundException ori.jasper.engine.base.JRBaseRectangle"
when reaching .....JasperPrint jasperPrint = JasperFillManager.fillReport(in, parameters, Database.instance().getConnection());

Code:

ByteArrayOutputStream compiledOutput = new ByteArrayOutputStream();

System.setProperty("jasper.reports.compile.temp", Configuration.instance().getAdvantagTempFolder());
System.setProperty("jasper.reports.compile.class.path",
getServletContext().getRealPath("/WEB-INF/lib/jasperreports.jar"));

JasperCompileManager.compileReportToStream(new FileInputStream(xmlFileName), compiledOutput);

Map parameters = new HashMap();

ByteArrayInputStream in = new ByteArrayInputStream(compiledOutput.toByteArray());
response.setContentLength(compiledOutput.toByteArray().length);
compiledOutput.close();

ServletOutputStream out = response.getOutputStream();

JasperPrint jasperPrint = JasperFillManager.fillReport(in, parameters, Database.instance().getConnection());
.......
....
Why it works some of the times, and some it raises error after the above line?
Please advise
Thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic