BLC 3.0 - ThymeleafMessageCreator not using WebContext?

Forum for questions and issues related to 3.0 migration.

Those wishing to upgrade should start by looking at the migration documents published on the Broadleaf Commerce documentation site.

Moderator: jocanas

janschraepen
Newbie
Newbie
Posts: 9
Joined: Thu Jun 27, 2013 6:38 am

BLC 3.0 - ThymeleafMessageCreator not using WebContext?

Postby janschraepen » Mon Jul 29, 2013 9:16 am

Hi

We're using mailNotifications in Broadleaf to send email when a checkout is being completed. This all works fine, as long as we're using the emailService.sendBasicEmail. From the moment on we"re trying to use the thymeleaf templates sending emails fails with the following exception:

Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Resource resolution by ServletContext with org.thymeleaf.resourceresolver.ServletContextResourceResolver can only be performed when context implements org.thymeleaf.context.IWebContext [current context: org.thymeleaf.context.Context]
at org.thymeleaf.resourceresolver.ServletContextResourceResolver.getResourceAsStream(ServletContextResourceResolver.java:74)
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:221)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1192)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1148)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1095)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1008)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:982)
at org.broadleafcommerce.common.email.service.message.ThymeleafMessageCreator.buildMessageBody(ThymeleafMessageCreator.java:54)
at org.broadleafcommerce.common.email.service.message.MessageCreator$1.prepare(MessageCreator.java:62)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:352)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.broadleafcommerce.common.email.service.message.MessageCreator.sendMessage(MessageCreator.java:40)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendBasicEmail(EmailServiceImpl.java:96)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:66)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:73)
...

Our configuration is as described in :
http://docs.broadleafcommerce.org/core/ ... figuration

Other fora indicate that a WebContext should be used to solve this problem, in stead of the Context that is used in Broadleaf's ThymeleafMessageCreator impl. Does anyone recognize this problem and/or has a solution for this?

Thx in advance!

Jan

Return to “3.0 Upgrade and Migration”

Who is online

Users browsing this forum: No registered users and 2 guests