grailsjasper-plugin

JasperReport Plugin error on grails 2.4.3


I have:

def reportDef = new JasperReportDef(name:'myreport.jasper', fileFormat:JasperExportFormat.PDF_FORMAT)
response.outputStream << jasperService.generateReport(reportDef).toByteArray()

and jasperService.generateReport(reportDef) is always giving me:

Error | 2015-01-06 14:06:53,449 [http-bio-8080-exec-7] ERROR errors.GrailsExceptionResolver  - NoSuchMethodError occurred when processing request: [POST] /CRM/contratoDesvincular/gerarRelatorio
com.lowagie.text.pdf.PdfWriter.setTabs(Lcom/lowagie/text/pdf/PdfName;)V. Stacktrace follows:
Message: Executing action [gerarRelatorio] of controller [org.catelani.crm.ContratoDesvincularController]  caused exception: Runtime error executing action
Line | Method
->>  198 | doFilter  in grails.plugin.cache.web.filter.PageFragmentCachingFilter

I have compile ":jasper:1.10.0" on BuildConfig.

Anyone knows what is going on?


Solution

  • The problem was with iText that comes with grails 2.4.3:

    build "com.lowagie:itext:2.1.7"
    

    This overrides the plugin used by grails and solves the problem.