Scott Posted August 14, 2006 Share Posted August 14, 2006 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.jarcommons-digester-1.7.jarcommons-javaflow-20060411.jarcommons-logging-1.0.2.jarcommons-logging-api-1.0.2.jaritext-1.3.1.jarjasperreports-1.2.5.jarpoi-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 thanksScott.Post edited by: Scott, at: 2006/08/14 10:12 Link to comment Share on other sites More sharing options...
Scott Posted August 22, 2006 Author Share Posted August 22, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now