cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 2.0 email exception when a rule is triggered

melkor_kp
Champ in-the-making
Champ in-the-making
I configured the mail setting the values with the right values of the repository.properties.

mail.host=192.168.0.2
mail.port=25
mail.username=alfresco
mail.password=alfresco
mail.encoding=UTF8
mail.header=Proof
mail.from.default=alfresco@myorganisation.org

And  I configured a rule which sends an email when a file which a
specific type is copied to a location.

If I check the alfresco.log I get the following error.

ERROR [org.alfresco.repo.action.executer.MailActionExecuter] Failed
to send email to null
org.springframework.mail.MailPreparationException: Could not prepare mail: null;
nested exception is java.lang.NullPointerException: null
5 REPLIES 5

melkor_kp
Champ in-the-making
Champ in-the-making
I would like to add that this happens when a rule is  applied, for example to
send a mail when a doc file is copied to a folder.

And I want to remark that it is alfresco 2.0.

The complete error is

13:40:00,980 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] Failed to send email to nu
ll
org.springframework.mail.MailPreparationException: Could not prepare mail: null; nested exception is
java.lang.NullPointerException: null
java.lang.NullPointerException
        at java.lang.String.concat(String.java:1827)
        at com.sun.activation.registries.MailcapFile.parseLine(MailcapFile.java:235)
        at com.sun.activation.registries.MailcapFile.parse(MailcapFile.java:197)
        at com.sun.activation.registries.MailcapFile.createMailcapHash(MailcapFile.java:157)
        at com.sun.activation.registries.MailcapFile.<init>(MailcapFile.java:40)
        at javax.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:276)
        at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:128)
        at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:44)
        at javax.activation.DataHandler.getCommandMap(DataHandler.java:136)
        at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:568)
        at javax.activation.DataHandler.writeTo(DataHandler.java:294)
        at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:230)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1124)
        at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1927)
        at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1908)
        at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:381)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:326)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:341)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:330)
        at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:
325)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstra
ctBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:5
37)
at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExec
uter.java:72)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstra
ctBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:5
37)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:472)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:399)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335
)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:148)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntrod
uctionInterceptor.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysP
roceedMethodInterceptor.java:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(E
xceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy12.setProperty(Unknown Source)
        at org.alfresco.repo.action.executer.TransformActionExecuter.executeImpl(TransformActionExec
uter.java:259)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstra
ctBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:5
37)
        at org.alfresco.repo.action.executer.CompositeActionExecuter.executeImpl(CompositeActionExec
uter.java:72)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstra
ctBase.java:120)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:5
37)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:472)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:399)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335
)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:148)
  at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntrod
uctionInterceptor.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysP
roceedMethodInterceptor.java:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(E
xceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy16.executeAction(Unknown Source)
        at org.alfresco.repo.rule.RuleServiceImpl.executeRule(RuleServiceImpl.java:915)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRule(RuleServiceImpl.java:883)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRulesImpl(RuleServiceImpl.java:854)
        at org.alfresco.repo.rule.RuleServiceImpl.executePendingRules(RuleServiceImpl.java:827)
        at org.alfresco.repo.rule.RuleTransactionListener.beforeCommit(RuleTransactionListener.java:
69)
at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.b
eforeCommit(AlfrescoTransactionSupport.java:591)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeC
ommit(AbstractPlatformTransactionManager.java:657)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(
AbstractPlatformTransactionManager.java:482)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(Abstrac
tPlatformTransactionManager.java:469)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionA
fterReturning(TransactionAspectSupport.java:266)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransactio
n.java:405)
        at org.alfresco.filesys.server.SrvSession.endTransaction(SrvSession.java:627)
        at org.alfresco.filesys.smb.server.SMBSrvSession.run(SMBSrvSession.java:1362)
        at java.lang.Thread.run(Thread.java:595)

melkor_kp
Champ in-the-making
Champ in-the-making
This is what ethereal returns.
I don't know how to do please I need help to know how to configure the
email funtionality in alfresco.

220 smtpmachine ESMTP Exim 4.66 Tue, 13 Mar 2007 11:00:03 +0100

EHLO workdesk

250-smtpmachine Hello workdesk [192.168.101.105]

250-SIZE 52428800

250-8BITMIME

250-AUTH LOGIN PLAIN

250-STARTTLS

250 HELP

QUIT

221 smtpmachine closing connection

tronxo
Champ in-the-making
Champ in-the-making
I've got the same problem, I am very worried because I do not find any documentation about the issue.

Does anybody know something about this strange mail error?
May be it is an error I will look at JIRA.

moisei
Champ in-the-making
Champ in-the-making
I've edited repository.properties directly under Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco
and it did the trick.
However, I am not sure this is a proper solution.
The manual states a files under webapps should never be changed

kayachi
Champ in-the-making
Champ in-the-making
The problem probably is that you have the repository-properties bean declared in more than 1 .xml file.

For instance in the default distributed 'custom-repository-context.xml' and 'custom-db-and-data-context.xml'.

The first one declares the bean with the standard 'repository.properties' and then overrides these settings with 'custom-repository.properties' in which you put your mail-setting.

After that however the bean is re-initialized in the 'custom-db-and-data-context.xml' file, this time only with the setting from 'repository.properties'.

The solution is to have the bean declared only once and make shure that the 'custom-repository.properties' file gets loaded.

Hopefully this helps…