0

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?

Alex K
  • 22,315
  • 19
  • 108
  • 236
Vitor Hugo
  • 1,106
  • 1
  • 15
  • 35

1 Answers1

1

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.

Vitor Hugo
  • 1,106
  • 1
  • 15
  • 35
  • 1
    This will solve the Jasper issue, but will also break the rendering plugin. See http://www.grailsforum.co.uk/showthread.php/2602-Making-Jasper-and-Rendering-plugins-work-together?p=4325#post4325 to get both working. – David Brown Feb 03 '15 at 08:10