Why do I get compilation error "org/codehaus/groovy/control/CompilationFailedException"?
Solution 1
You will have to set the language
value in your template to Java. There are two ways you can do this:
If you are using iReport, select the root object in your Report Inspector (the one with the same name as your report). Then in the Properties window, select Java from the Languages drop-down.
If you are editing the raw mark-up in the JRXML file, remove
language="groovy"
from the file altogether.
Then try to recompile - you should be sorted. :)
Solution 2
If you are using Maven, you must add the groovy dependency in your pom.xml.
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.10</version>
</dependency>
In another case, you must add the library groovy in your lib folder (WEB-INF/lib)
Solution 3
Another solution is to copy groovy-all-{version}.jar from the groovy binary distribution into the application's.
Solution 4
If you are using TIBCOJaspersoftStudio:
- Download latest groovy 2.4.* jar from https://groovy.apache.org/download.html
- Unpack and get this file ./groovy-2.4.10/embeddable/groovy-all-2.4.10.jar
- Put the jar in ./TIBCOJaspersoftStudio-6.3.1.final/plugins
- Delete the old jar: ./TIBCOJaspersoftStudio-6.3.1.final/plugins/groovy-all_2.4.5.jar
Solution 5
Change the languge to java in JRXML (ex:- language="java") or add groovy*.jar to your project’s classpath.
Admin
Updated on May 31, 2021Comments
-
Admin almost 3 years
I am trying to compile my JasperReports template using an Ant script and Java. I am getting this error:
jasper java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
There is nothing complex in the template, but I still can't compile.
-
MatuDuke over 10 yearsDon't forget to compile de .jasper file once .jrxml is modified!
-
ADTC almost 10 yearsBad solution, as you're merely satisfying a new and unnecessary dependency requirement. In travega's answer you're removing the dependency requirement completely, which is the better way to go.
-
Petter Friberg over 8 yearsThis depends on whether you are using groovy expression or not in your report...., switching to java will make your groovy expression as == fail. (note the solution is to copy the libraries from the jasper report distribution (lib) relative to groovy in the classpath)
-
Matthew Clark almost 6 yearsThese steps are what helped me solve this problem. Care to explain why your answer would be appropriate?
-
Sorter almost 5 yearsif you using maven, please check you dont put
<scope>provided</scope>