unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator

1
 
 
I'm using Jasper Studio 5.5.1 trying to open my .JRXML files which were created using iReport 5.5.0.
 
The reports are working correctly in iReport, in Jasper Studio I create a brand new Jasper project and copy the JRXML files in. However I come across the following error when trying to compile:
 
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
calculator_Receipt_1397035857101_637810: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator 
 @ line 18, column 1.
calculator_Receipt_Receipt_1397035857101_637810: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator 
 @ line 18, column 1.
calculator_Receipt_dataset1_1397035857101_637810: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator 
 @ line 18, column 1.
3 errors
 
at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:113)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:172)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.compileJasperDesign(ReportControler.java:398)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$14(ReportControler.java:386)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler$4.run(ReportControler.java:319)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
 
I check my class path and Jasper Libraries is included. I suspect the Groovy evaluator is needed for expressions such as:
 
 <variable name="isRent" class="java.lang.Boolean">
  <variableExpression><![CDATA[$F{allocation_charge_category}.equals("Rent") ? Boolean.TRUE : $V{isRent}]]></variableExpression>
  <initialValueExpression><![CDATA[Boolean.FALSE]]></initialValueExpression>
</variable>
Please advice if there is a work around or did I miss anything in my setup.
yun.zhi.lin's picture
Joined: Mar 18 2014 - 9:43pm
Last seen: 4 years 11 months ago

According to this (https://stackoverflow.com/a/43354536/1152679) answer from StackOverflow, you have to

replace groovy for a more recent version.

Delete TIBCOJaspersoftStudio-x.x.x.final/plugins/groovy-all_2.4.5.jar

and replace for groovy-2.4.12/embeddable/groovy-all-2.4.12.jar

This works for me.

atilacamurca - 1 year 5 months ago

2 Answers:

-1

I was able to resolve this by removing:

language="groovy"

in my JRXML file

yun.zhi.lin's picture
Joined: Mar 18 2014 - 9:43pm
Last seen: 4 years 11 months ago

groovy as you're using language validation. The library JASPER REPORT used a class that is not in the jars,

to solve this problem switch to java, in the report properties

hermy991 - 5 years 1 week ago

Switching to Java when Groovy is a supported feature isn't really a correct fix. The issue is caused by Jasper Studio 5.5.1 which didn't have the correct jars. Groovy is working correctly which I upgraded to Jasper Studio 5.5.2

yun.zhi.lin - 4 years 11 months ago

Did you ever find a solution to this? I'm having the same problem with 6.0, I can't get rid of the language="groovy" parameter as I'm actually using expressions written in Groovy (if I get rid of it, it seems to default back to Java, causing expression compilation errors).

cameron_1 - 4 years 3 months ago
-5

groovy as you're using language validation. The library JASPER REPORT used a class that is not in the jars,

to solve this problem switch to java, in the report properties

hermy991's picture
Joined: Aug 1 2012 - 8:40am
Last seen: 2 months 1 week ago
Feedback
randomness