Code: Select all
[ERROR] 00:53:45 VelocityEngine - ResourceManager : unable to find resource 'register-email' in any resource loader.
I checked tomcat6 and see the template html files are under $tomcat_home/webapps/myapp/WEB-INF/classes/emailTemplates/. Don't know why it doesn't locate the template. Here is my applicationContext-email.xml:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<description>Property configurer for notification service properties input.</description>
<property name="locations">
<list>
<value>file:///${CATALINA_HOME}/config/commerce/email/email.properties</value>
</list>
</property>
</bean>
<bean id="blServerInfo" class="org.broadleafcommerce.common.email.service.info.ServerInfo">
<property name="serverName" value="${server.name}" />
<property name="serverPort" value="${server.port}" />
</bean>
<bean id="blMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host"><value>${mail.smtp.host}</value></property>
<property name="port"><value>${mail.smtp.port}</value></property>
<property name="protocol"><value>${mail.smtp.protocol}</value></property>
<property name="username"><value>${mail.smtp.username}</value></property>
<property name="password"><value>${mail.smtp.password}</value></property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.starttls.enable">false</prop>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
</props>
</property>
</bean>
<bean id="blEmailTemplateResolver" class="org.thymeleaf.templateresolver.ClassLoaderTemplateResolver">
<property name="prefix" value="emailTemplates/" />
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
<property name="cacheable" value="false"/>
</bean>
<bean id="blEmailTemplateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolvers">
<set>
<ref bean="blEmailTemplateResolver" />
</set>
</property>
<property name="dialects">
<set>
<bean class="org.thymeleaf.spring3.dialect.SpringStandardDialect" />
<ref bean="blDialect" />
</set>
</property>
</bean>
<bean id="blMessageCreator" class="org.broadleafcommerce.common.email.service.message.ThymeleafMessageCreator">
<constructor-arg ref="blEmailTemplateEngine"/>
<constructor-arg ref="blMailSender"/>
</bean>
<bean id="blEmailInfo" class="org.broadleafcommerce.common.email.service.info.EmailInfo">
<property name="fromAddress" value="${mail.smtp.from}" />
<property name="sendEmailReliableAsync" value="false" />
<property name="sendAsyncPriority" value="2" />
</bean>
<bean id="blRegistrationEmailInfo" parent="blEmailInfo">
<property name="subject" value="You have successfully registered!"/>
<property name="emailTemplate" value="register-email"/>
</bean>
<bean id="blForgotPasswordEmailInfo" parent="blEmailInfo">
<property name="subject" value="Reset password request"/>
<property name="emailTemplate" value="resetPassword-email"/>
</bean>
<bean id="blOrderConfirmationEmailInfo" parent="blEmailInfo">
<property name="subject" value="Your order with My Company"/>
<property name="emailTemplate" value="orderConfirmation-email"/>
</bean>
</beans>
I can't see anything wrong. Can anyone point out the problem?
Thank you in advance!
-Charlie