cancel
Showing results for 
Search instead for 
Did you mean: 

Error when try send email notification(not always)

aleks_sh
Champ in-the-making
Champ in-the-making
Hello
I had rule which send email if some documents enter to the folder
this is my template:

<#assign ref=space.nodeRef>
<#assign displayPaths=document.displayPath?split("/")>
<#assign site=displayPaths[3]>

<#assign spacePaths=document.nodeRef?split(":/")>
<#assign wstore=spacePaths[0]>
<#assign sstore=spacePaths[1]>

Hello!

please see new document '${document.name}' at folder '${space.name}'.

click this link to see document:
https://192.168.11.1/share/page/site/${site}/document-details?nodeRef=${document.nodeRef}

click this link to download document:
https://192.168.11.1/share/proxy/alfresco/api/node/content/${wstore}${sstore}/${document.name?url('U...



Regards,
${person.properties.firstName}<#if person.properties.lastName?exists> ${person.properties.lastName}</#if>

But often email has not sent:
in catalina.log i see that:

2011-11-24 15:13:10,740  ERROR [repo.transaction.AlfrescoTransactionSupport] [de
faultAsyncAction2] After completion (committed) listener exception:
   listener: org.alfresco.repo.action.executer.MailActionExecuter$1@2c26618f
org.alfresco.error.AlfrescoRuntimeException: 10241600 Failed to send email to:[
aleksandr.shamanov]
        at org.alfresco.repo.action.executer.MailActionExecuter.prepareAndSendEm
ail(MailActionExecuter.java:572)
        at org.alfresco.repo.action.executer.MailActionExecuter.access$000(MailA
ctionExecuter.java:68)
        at org.alfresco.repo.action.executer.MailActionExecuter$1.afterCommit(Ma
ilActionExecuter.java:311)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionS
ynchronizationImpl.afterCompletion(AlfrescoTransactionSupport.java:841)
        at org.springframework.transaction.support.TransactionSynchronizationUti
ls.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.processCommit(AbstractPlatformTransactionManager.java:799)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.commit(AbstractPlatformTransactionManager.java:723)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.
commitTransactionAfterReturning(TransactionAspectSupport.java:393)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(Sprin
gAwareUserTransaction.java:472)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:410)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:259)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionE
xecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:412)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(Au
thenticationUtil.java:519)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionE
xecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:415)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/3ae7a557-436a-48b3-ae2f-0b626b4d4dc0(Status[changeTxnId=ed5f1513-4181-42fc-9508-76ad7e7f1cac, dbTxnId=172790, deleted=true])
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:367)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
        at org.alfresco.repo.action.executer.MailActionExecuter.prepareAndSendEmail(MailActionExecuter.java:540)
        … 18 more
Caused by: org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/3ae7a557-436a-48b3-ae2f-0b626b4d4dc0(Status[changeTxnId=ed5f1513-4181-42fc-9508-76ad7e7f1cac, dbTxnId=172790, deleted=true])
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:176)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getPrimaryParent(DbNodeServiceImpl.java:1875)
        at sun.reflect.GeneratedMethodAccessor302.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:104)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy8.getPrimaryParent(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor302.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:215)
        at $Proxy9.getPrimaryParent(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor302.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:129)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:129)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.tagging.TagScopePropertyMethodInterceptor.invoke(TagScopePropertyMethodInterceptor.java:129)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:269)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy8.getPrimaryParent(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor302.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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.audit.DisableAuditableBehaviourInterceptor.invoke(DisableAuditableBehaviourInterceptor.java:100)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:146)
        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 $Proxy8.getPrimaryParent(Unknown Source)
        at org.alfresco.repo.action.executer.MailActionExecuter.createEmailTemplateModel(MailActionExecuter.java:617)
        at org.alfresco.repo.action.executer.MailActionExecuter.access$800(MailActionExecuter.java:68)
        at org.alfresco.repo.action.executer.MailActionExecuter$2.prepare(MailActionExecuter.java:470)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:352)
        … 20 more


On alfresco 3.4d email notification is worked correctly
My enviroment:
opensuse linux 11.3
alfresco community 4.0b
mysql
lucene indexing

Please help.
5 REPLIES 5

bremmington
Champ on-the-rise
Champ on-the-rise
That stack trace suggests that the node causing the email has been deleted by the time the email is being sent. Do you have any other rules that could cause that to happen?

aleks_sh
Champ in-the-making
Champ in-the-making
thanks for answer Brian
all rules are identical
in fact the same rule one time is worked, but second  - not
for example if upload  4 documents - 3 times rule is worked, once - not.

aleks_sh
Champ in-the-making
Champ in-the-making
it seems problem first time occurs if letter has many (20-30) recipient

aleks_sh
Champ in-the-making
Champ in-the-making
to folder is binded 2 rules, both email notification
one worked if document is entered to the folder, second rule send mail if are created  comments to this document

<#assign ref=space.nodeRef>
<#assign displayPaths=document.displayPath?split("/")>
<#assign site=displayPaths[3]>
<#assign folderparent=document.parent.parent.parent>

<#assign spacePaths=document.nodeRef?split(":/")>
<#assign wstore=spacePaths[0]>
<#assign sstore=spacePaths[1]>

<#assign comments=document.content?replace("</?[^>]+(>|$)", "", "r")?replace(" ", "", "r")>


Hello

User ${person.properties.firstName}<#if person.properties.lastName?exists> ${person.properties.lastName}</#if> add new comment to document  ${folderparent.name}:

'${comments}'

You can see document and comments by clicking to link:
https://192.168.11.1/share/page/site/${site}/document-details?nodeRef=${folderparent.nodeRef}

kwilliamsjr
Champ in-the-making
Champ in-the-making
great template btw.