Template rendered outside a page-request causes blank content when containing application links
This is caused by an NPE thrown at the getter of
utils.ThreadLocalServlet.getContextPath
, which gets invoked to retrieve the absolute path which in turn is needed to render a page link that is part of the email-body. If this mail is rendered in a recurring task (read: outside a request),ThreadLocalServlet
will be null, causing the email-body to be empty.Debug trace:
Submitted by Elmer van Chastelet on 26 September 2013 at 13:05[26 Sep 12:56:26 researchr] ERROR ThreadLocalServlet.get() is null! causes NPE, here is the stack trace java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1344) at utils.ThreadLocalServlet.getContextPath(ThreadLocalServlet.java:19) at utils.PageServlet.getAbsoluteLocation(PageServlet.java:7173) at webdsl.generated.templates.outputUsergroup_Template.renderInternal(outputUsergroup_Template.java:348) at utils.TemplateServlet.render(TemplateServlet.java:102) at webdsl.generated.templates.outputRecipient_Template.renderInternal(outputRecipient_Template.java:606) at utils.TemplateServlet.render(TemplateServlet.java:102) at webdsl.generated.templates.recipientsMessage_Template.renderInternal(recipientsMessage_Template.java:619) at utils.TemplateServlet.render(TemplateServlet.java:102) at webdsl.generated.templates.sendMessageMessage__User_ta0User__Message_Template.renderInternal(sendMessageMessage__User_ta0User__Message_Template.java:526) at utils.TemplateServlet.render(TemplateServlet.java:102) at webdsl.generated.templates.par_Template.renderInternal(par_Template.java:244) at utils.TemplateServlet.render(TemplateServlet.java:102) at webdsl.generated.templates.sendMessage_Email_Template.renderInternal(sendMessage_Email_Template.java:148) at webdsl.generated.templates.sendMessage_Email_Template.render(sendMessage_Email_Template.java:88) at utils.AbstractPageServlet.renderEmail(AbstractPageServlet.java:540) at utils.PageServlet.renderEmailAndCreateQueuedEmail(PageServlet.java:7193) at webdsl.generated.domain.MessageBox.receiveMessage__User_(MessageBox.java:484) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) ...
Issue Log
On 2 October 2013 at 17:36 Elmer van Chastelet commented:
Fixed in r5799
On 2 October 2013 at 17:36 Elmer van Chastelet closed this issue.
Log in to post comments