How to Handle Jasper Report’s CompilationFailedException

I always use JasperReport for my java projects, but sometimes i found some weird java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException when im trying to get reports from jasper files. This is my full stack trace exception.

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:472)
        at net.sf.jasperreports.engine.JasperCompileManager.loadEvaluator(JasperCompileManager.java:238)
        at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:416)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:408)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:74)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:56)
        at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:143)
        at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:79)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)

Actually it happens because im still using Groovy as my report language, instead of Java. All i have to do is change reporting language to java, as you can see below.

Or adding groovy*.jar to your project’s classpath.

Have fun, cheers. (B)

17 Comments

nis

about 10 years ago

Thank you. It really helped me to solve the problem.

Reply

edwin

about 10 years ago

anytime nis, glad it can help :)

warrior

about 10 years ago

thx,it really helped

Reply

edwin

about 10 years ago

hi Warrior, glad it could helped you.

Manuel gregorio Isaza Monterrosa

about 9 years ago

muchas gracias por ese aporte, estaba desesperado y ya lo pude corregir.....

Reply

edwin

about 9 years ago

eres amigo de bienvenida,

Mangesh

about 9 years ago

gr8, it really helped

Reply

edwin

about 9 years ago

Hi Mangesh, glad it can help :)

Walter Giraldo Mejia

about 8 years ago

Gracias Me ayudo tremendamente, realmente gracias.... te pasaste...! :)

Reply

edwin

about 8 years ago

Hi Walter, glad it can help :)

Moro

about 8 years ago

Works!!! thanks a lot :-)

Reply

edwin

about 8 years ago

Hi Moro, glad it can help

Reedyseth

about 8 years ago

Thanks this worked for me. Just switching to Java solve my problem. I also noticed that I can integrate it with Javascript, so I am happier because I am a Web Developer.

Reply

edwin

about 8 years ago

wow cool, i never tought that jasper able to use javascript.

doank

about 7 years ago

thank you :-D (Y)

Reply

awab

about 5 years ago

where can I find groovy*.jar

Reply

edwin

about 5 years ago

you can find it on your jasper or ireport installation folder

Leave a Comment

Please be polite. We appreciate that.
Your email address will not be published and required fields are marked