Skip to content

rxjava-groovy - scala - Template not found exception #18

@fupelaqu

Description

@fupelaqu

Hi,

I am not sure if this issue is related to grails-rendering, anyway when I tried to generate a pdf I always got an UnknownTemplateException (grails.plugin.rendering.document.UnknownTemplateException: Could not find template for '/test')

My template is located in /grails-app/views/_test.gsp and pdfRenderingService is called within a method "test" this way

            Future<Collection<XXX>> futureResult = ...
            ...
            futureResult.onComplete({scala.util.Try<Collection<XXX>> t ->
                Collection<XXX> coll = t.get()
                coll.each { item ->
                    try{
                        test(item)
                    }
                    catch(Throwable th){
                        log.error(th.message, th)
                    }
                }
            } as Function1, ec)

    void test(XXX item){
        ...
        final template = "/test"
        def bos = new ByteArrayOutputStream()
        pdfRenderingService?.render([template: template, model:model], bos)
        ...
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions