Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke method getBean() on null object when gsp contains g:select #12

Open
danpolites opened this issue Nov 14, 2015 · 1 comment

Comments

@danpolites
Copy link

PDF rendering is failing when the GSP contains a g:select tag. I'm able to use other grails tags along with my own tags. I am using grails 2.4.4 (also tried 2.4.5) and version 0.1.10 of the plugin. Looks like it may be an issue with the mail plugin that's doing the rendering.

Here is the error I see:

Cannot invoke method getBean() on null object. Stacktrace follows:
java.lang.NullPointerException: Cannot invoke method getBean() on null object
    at show_gsp$_run_closure2.doCall(show_gsp:53)
    at show_gsp.run(show_gsp:64)
    at grails.plugin.mail.MailMessageContentRenderer$_render_closure1.doCall(MailMessageContentRenderer.groovy:66)
    at grails.plugin.mail.MailMessageContentRenderer$RenderEnvironment.with(MailMessageContentRenderer.groovy:180)
    at grails.plugin.mail.MailMessageContentRenderer.render(MailMessageContentRenderer.groovy:63)
    at org.wkhtmltox.WkhtmltoxService.renderMailView(WkhtmltoxService.groovy:67)
    at org.wkhtmltox.WkhtmltoxService.makePdf(WkhtmltoxService.groovy:42)
    at org.wkhtmltox.WkhtmltoxService.makePdf(WkhtmltoxService.groovy:37)
    at MyService.generatePdf(MyService.groovy:2884)
    at MyController.pdf(MyController.groovy:40)
    at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:49)
    at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Here's the line (913) from the grails 2.4.4 FormTagLib that I suspect the mail plugin is having issues with:

def messageSource = grailsAttributes.getApplicationContext().getBean("messageSource")

Thoughts on a work around?

@rlovtangen
Copy link
Owner

Are you able to use mail plugin directly with the same markup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants