Jump to content
Changes to the Jaspersoft community edition download ×

[Jasper Reports 1.2.5 on Jboss 4] Errors


Scott

Recommended Posts

Hi,

 

I have written a small j2ee app using Jasper Reports and servlets that I am trying to deploy on JBoss 4.0.3SP1.

 

-------------------------------

The Jasper jars I am using are:

commons-collections-2.1.jar

commons-digester-1.7.jar

commons-javaflow-20060411.jar

commons-logging-1.0.2.jar

commons-logging-api-1.0.2.jar

itext-1.3.1.jar

jasperreports-1.2.5.jar

poi-2.0-final-20040126.jar

 

 

 

The app starts up fine but when I try to use the JasperFillManager in my code to fill the report I get the following error:

 

 

 

java.lang.ClassCastException: net.sf.jasperreports.engine.design.JRJavacCompiler

at net.sf.jasperreports.engine.design.JRDefaultCompiler.getCompiler(JRDefaultCompiler.java:201)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.loadEvaluator(JRDefaultCompiler.java:216)

at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:402)

at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:350)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:92)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:74)

at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)

 

 

 

My pdf gen code looks like this:

 

File reportFile = null;

JasperPrint jasperPrint = null;

 

reportFile = new File(getLocations(). getReportLocation(NamesOfReports.QUOTATION_REPORT));

 

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

 

Map parameters = new HashMap();

 

jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new QuotationDataSource());

 

byte[] bytes = JasperExportManager.exportReportToPdf(jasperPrint);

 

os.write(bytes);

os.flush();

 

 

 

Any ideas?

 

Many thanks

Scott.

Post edited by: Scott, at: 2006/08/14 10:12

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This problem relates to class path issues.

 

I fixed this by moving the jars I listed in the original post, to the jboss/server/default/lib folder.

 

I then removed those jars from the .war and .ear and also remove all entries related to these jars from the respective manifest entries.

 

This works for applications packaged as .ear j2ee apps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...