Jasper report will not run - unknown errors

0

Hi, I'm trying to get a basic jasper report to run. I have a jrxml created in ireport in the directory listed but I just get errors? Code below:

private void pdfBtnActionPerformed(java.awt.event.ActionEvent evt) {                                       
         try
        {
            JasperReport jasperReport = null;
            JasperPrint jasperPrint = null;
            JasperDesign jasperDesign = null;
            Map parameters = new HashMap();
            jasperDesign = JRXmlLoader.load("/Users/admin/Documents/HCCE/Semester 2/OOP/Projects2/OMFinancials/src/ie/orderofmalta/OMACtest.jrxml");
            jasperReport = JasperCompileManager.compileReport(jasperDesign);
            jasperPrint  = JasperFillManager.fillReport(jasperReport, parameters, new JRBeanCollectionDataSource(ie.orderofmalta.BeanFactory.getCalcs()));
            JasperExportManager.exportReportToPdfFile(jasperPrint,"OMACTEST.pdf");
            JasperViewer.viewReport(jasperPrint);
        }
        catch(Exception ex)
        {
            System.out.println("EXCEPTION: "+ex);
        }
    }                 

log4j:WARN No appenders could be found for logger (net.sf.jasperreports.extensions.ExtensionsEnvironment).

log4j:WARN Please initialize the log4j system properly.

Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
at net.sf.jasperreports.functions.FunctionsBundle.addFunctionClass(FunctionsBundle.java:84)
at net.sf.jasperreports.functions.FunctionsBundle.<init>(FunctionsBundle.java:54)
at net.sf.jasperreports.functions.FunctionsRegistryFactory.createRegistry(FunctionsRegistryFactory.java:76)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:239)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:214)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:162)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:133)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:105)
at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:584)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:930)
at jaspertest.JasperTest.main(JasperTest.java:28)
Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadableInstant
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 22 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
 
I don't understand what is happening. Even when I create a basic report to test I get these errors. Can anyone help?
eoin.sutton's picture
Joined: May 20 2014 - 5:11am
Last seen: 5 years 2 months ago

1 Answer:

1

from the error log it sound like you are missing a jar file for jodatime  and that is why you are missing the class (org/joda/time/ReadableInstant) try this link http://joda-time.sourceforge.net/installation.html

 

 

haidar_hadi_205's picture
Joined: May 14 2014 - 12:47pm
Last seen: 5 years 4 months ago

Thank you so much! It works!

eoin.sutton - 5 years 6 months ago
Feedback
randomness