Search code examples
javaeclipsejasper-reports

Eclipse - Jasper report not compiling (java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester)


I am trying to generate a jasper report via the Eclipse ide, however when I execute the following line of code:

jasperReport = JasperCompileManager.compileReport("reports/samplereport.jrxml");

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:146)

I have added the apache common digester jar as a project library but it does not seem to make a difference. NOTE: I am from a java novice (i.e. Ive a .NET background,) so I am very likely doing something really obvious!


Solution

  • you may be missing some jars. try to add these ones with any version.

    jasperreports-.jar;
    jasperreports-javaflow.jar;
    commons-beanutils.jar;
    commons-collections.jar;
    commons-logging.jar;
    commons-digester.jar