Rendering a GSP in grails as PDF via a Quartz Job problems

Has anyone had success in Grails 1.3.7 rendering gsps inside a quartz job?

I'm having a tough time getting it to work, tried various options including the template engine plugin, and the renderer plugin.

The Grailstemplateengine plugin doesn't get far at all, when the call is made to render, I get:

 No signature of method: GrailsTemplateEngineService.renderWithTemplateEngine() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap) values: [/reports/templates/product_summary, [model:net.dbws.ieur.ProductSummaryModel@356eb0]]

Renderer plugin looks to be getting the furtherest except it seems to not control its own output correctly, calling pdfRenderingService() appears to be outputting the rendered PDF to standard out, as I'm seeing the content output in the IDE's output window, rather than rednering to its own byte array. And its raising an exception as its doing some kind of illegal cast as mixed in the output I can see 'java.io.ByteArrayOutputStream' to class 'java.lang.Number' [See nested exception: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '%PDF-1.4'

So if anyone had success rendered gsps from within a quartz job, i'd love to know how you did it.

Thanks,

Answers


Ok found issue.... The docs for the grails template engine were totally out of date and incorrect.. it should have been calling 'renderView' not renderWithTemplateEngine


Need Your Help

Synonym finder algorithm

php python algorithm synonym data-analysis

I think example will be much better than loooong description :)

Does Task.Wait(int) stop the task if the timeout elapses without the task finishing?

c# .net multithreading task-parallel-library task

I have a task and I expect it to take under a second to run but if it takes longer than a few seconds I want to cancel the task.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.