Milos Zikic - Personal site, sharing thoughts about startups, products and engineering

Groovy and JasperReports

Yesterday I was trying out to the new iReport 3.6 to generate some reports. Everything went fine but on trying to run the report inside the app I've got:

java.lang.NoClassDefFoundError: 
org/codehaus/groovy/control/CompilationFailedException


This was pretty awkward since I didn't reference any of the groovy stuff inside the code nor in the reports.

After opening the .jrxml source and comparing it with the older version that I had I noticed the language="groovy" attribute in the jreport element.

I don't know how this got set there but seems that groovy is the default from now on. When I removed this and recompiled the report everything worked great.

Comments

Anonymous
I have the same problem today, I spent more than 3 hours to got a solution. More about that at http://javanus.com/blog/?p=199.

Regards,
Javanus.com
Miloš Žikić
True with dependency but I didn't want to add a groovy jar to the libs since I am not using it anywhere. So I had to dig down to search why and how it was referenced.
iacwebsysadmin
As stated at the site below, you can add the Groovy JAR to your project by copying ireport/modules/ext/groovy-all-{version}.jar to /WEB-INF/lib

http://grails-groovy.blogspot.com/2009/08/groovy-compilation-problem-while.html
iacwebsysadmin
This comment has been removed by the author.

Share this post