Jump to content
We've recently updated our Privacy Statement, available here ×

Problems using Groovy with Jaspersoft Studio


rjohnson.uiuc

Recommended Posts

We are using Jaspersoft Studio 6.14.0.    We have been using Jasper Reports for a long time on a large Groovy project.    The reports are only a small part of the system, but an important part.  They are all written using Groovy.  

I didn't write any of the reports, but I did the conversion from a very old version of Jasper Reports that used iReports to a version that uses Jaspersoft Studio.

Recently Studio has started complaining about almost all our reports.  They all give the same error.  It happens when we try to "preview" the design.  We are told there are compilation errors.

Errors were encountered when compiling report expression class file: org.codehaus.groovy.control.MultipleCompilationException: startup failed

Looking at the text of the error, we get:

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
calculator_CashReportSearch_Cash_1601284259313_503841: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator 
 @ line 18, column 1.
1 error
.
    at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:126)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:227)
    at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:289)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.compileJasperDesign(ReportController.java:482)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$8(ReportController.java:467)
    at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:385)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
calculator_CashReportSearch_Cash_1601284259313_503841: 18: unable to resolve class net.sf.jasperreports.compilers.GroovyEvaluator 
 @ line 18, column 1.
 

So, it is trying to compile a class that represents one or more of the expressions in the report, and it fails because it was unable to find GroovyEvaluator, which is supposed to be a class in JasperReports.  

StackOverflow had the following unhelpful response, which is basically to stop using Groovy.

https://stackoverflow.com/questions/57673137/unable-to-resolve-class-net-sf-jasperreports-compilers-groovyevaluator-error-in

The reason the programmer tried to change the jar that implements Groovy is because of this message, which looks like the same error.  The solution this time was to update the jar that implements Groovy.   But now Jasper Reports seems to be using an up-to-date version of Groovy.

https://community.jaspersoft.com/jaspersoft-studio/issues/9476

My team-member who uses Jaspersoft Studio says that it seemed to work after I converted everything last year and he quit using iReports.  He changed some reports then and hadn't done anything with Studio for quite a while.   He tried to use it last week and it was broken.   I suggesed getting the latest version of Studio and it was still broken.   Any suggestions what to do?   If necessary, I can download the source code and have at it, but I've already got a lot of code to maintain and would appreciate a simpler fix.

I have attached a typical jrxml file that causes problems.  We have used it for some years, then a year ago I converted everything to the latest version of Jasper Reports and might have changed it then.   The odd thing is that our application can convert this to file to a .jasper file, so it just seems to be a problem with Studio, and not with Jasper Reports.

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...