Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-19515

Failed to send email by template

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Not a bug
    • Affects Version/s: 4.2 Enterprise
    • Fix Version/s: 4.2 Enterprise
    • Component/s: Rules and Actions
    • Security Level: external (External user)
    • Labels:
      None
    • Environment:
      Alfresco Enterprise HEAD-QA v4.2.0 (r53479-b203), RHEL 6.3 X64, Oracle 11g R2(11.2.0.3), Ojdbc6.jar use ‘jdbc:oracle:thin’ in db_url, Tomcat 7.0.42, JDK 7 U25, Alfresco+ OpenLDAP 2.4.23, IE9, Windows 7 X64, MS Outlook 2010
    • Testcase ID:
      Hide

      Enterprise40x-3665

      Show
      Enterprise40x-3665
    • Regression:
      Regression

      Description

      The issue is regression since v4.1.5.

      Email subsystem is configured correctly;
      Any user with valid email is created;

      Steps to reproduce:

      • Log into Share;
      • Create any site;
      • Create a folder;
      • Open "New Rule" page for the folder;
      • Fill in the "Name" field, select "inbound" rule type;
      • Select the "Send email" action;
      • Click the "Message" button > select any user with a valid email > fill in the "Subject" field > expand "Use Template" menu > select any localized template (e.g. notify_user_email.html.ftl) > click the "OK" button;
      • Click the "Create" button;
      • Open the folder with created rule and upload any file;
      • Ensure that the email is sent with the template you selected -->

      Result: The email is not received and the following errors are reported in the log:

      09:07:01,694 ERROR [freemarker.runtime] Template processing error: "Expression person is undefined on line 38, column 57 in workspace://SpacesStore/3bcb8423-6986-4b89-bc37-8dc037958005."
      
      Expression person is undefined on line 38, column 57 in workspace://SpacesStore/3bcb8423-6986-4b89-bc37-8dc037958005.
      The problematic instruction:
      ----------
      ==> ${person.properties.firstName} [on line 38, column 55 in workspace://SpacesStore/3bcb8423-6986-4b89-bc37-8dc037958005]
      ----------
      
      Java backtrace for programmers:
      ----------
      freemarker.core.InvalidReferenceException: Expression person is undefined on line 38, column 57 in workspace://SpacesStore/3bcb8423-6986-4b89-bc37-8dc037958005.
      	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
      	at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
      	at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
      	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
      	at freemarker.core.Dot._getAsTemplateModel(Dot.java:74)
      	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
      	at freemarker.core.Expression.getStringValue(Expression.java:93)
      	at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
      	at freemarker.core.Environment.visit(Environment.java:221)
      	at freemarker.core.MixedContent.accept(MixedContent.java:92)
      	at freemarker.core.Environment.visit(Environment.java:221)
      	at freemarker.core.Environment.process(Environment.java:199)
      	at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:218)
      	at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:177)
      	at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:240)
      	at org.alfresco.repo.action.executer.MailActionExecuter$3.prepare(MailActionExecuter.java:840)
      	at org.alfresco.repo.action.executer.MailActionExecuter.prepareEmail(MailActionExecuter.java:901)
      	at org.alfresco.repo.action.executer.MailActionExecuter.prepareEmails(MailActionExecuter.java:533)
      	at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:451)
      	at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:258)
      	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)
      	at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at com.sun.proxy.$Proxy348.execute(Unknown Source)
      	at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:838)
      	at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExecuter.java:66)
      	at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:258)
      	at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:838)
      	at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:738)
      	at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:572)
      	at sun.reflect.GeneratedMethodAccessor1258.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:161)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at com.sun.proxy.$Proxy47.executeAction(Unknown Source)
      	at org.alfresco.repo.rule.RuleServiceImpl.executeAction(RuleServiceImpl.java:1250)
      	at org.alfresco.repo.rule.RuleServiceImpl.executeRule(RuleServiceImpl.java:1244)
      	at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:1190)
      	at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:1119)
      	at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:1092)
      	at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:57)
      	at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:737)
      	at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:717)
      	at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:683)
      	at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:95)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:927)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:737)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
      	at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:472)
      	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:469)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:508)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:546)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:358)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
      	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
      	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:724)
      09:07:06,732 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] Failed to send email to [admin]
      org.springframework.mail.MailSendException: Failed messages: javax.mail.MessagingException: Unknown encoding: ${mail.header}; message exception details (1) are:
      Failed message 1:
      javax.mail.MessagingException: Unknown encoding: ${mail.header}
      	at javax.mail.internet.MimeUtility.encode(MimeUtility.java:335)
      	at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1349)
      	at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1683)
      	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:585)
      	at org.alfresco.repo.mail.AlfrescoJavaMailSender$PooledTransportWrapper.sendMessage(AlfrescoJavaMailSender.java:165)
      	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:416)
      	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
      	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
      	at org.alfresco.repo.action.executer.MailActionExecuter.sendEmail(MailActionExecuter.java:922)
      	at org.alfresco.repo.action.executer.MailActionExecuter.access$400(MailActionExecuter.java:87)
      	at org.alfresco.repo.action.executer.MailActionExecuter$2$1.execute(MailActionExecuter.java:471)
      	at org.alfresco.repo.action.executer.MailActionExecuter$2$1.execute(MailActionExecuter.java:466)
      	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:447)
      	at org.alfresco.repo.action.executer.MailActionExecuter$2.afterCommit(MailActionExecuter.java:465)
      	at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.afterCompletion(AlfrescoTransactionSupport.java:831)
      	at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:799)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
      	at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:472)
      	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:469)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:508)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:546)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:358)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
      	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
      	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:724)
      

      Note: The email without template is sent successfully;

      EugeneS

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedissues Closed Issues
                  Reporter:
                  alfrescoqa Alfresco QA Team (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Date of First Response:

                    Structure Helper Panel