cancel
Showing results for 
Search instead for 
Did you mean: 

Email content rule problems

tregi
Champ in-the-making
Champ in-the-making
Hi,
i'm having some trouble using an email content rule on a space. I use the wizard to set the user who will receive an email when a new item is added to the space. It seems to work, but if i go somewhere else and then get back to edit the rule again i get a java.lang.NullPointerException. These are the exception's details:

java.lang.NullPointerException
at org.alfresco.web.bean.wizard.WizardManager.getBean(WizardManager.java:137)
at org.alfresco.web.bean.actions.handlers.MailHandler.prepareForEdit(MailHandler.java:76)
at org.alfresco.web.bean.rules.EditRuleWizard.init(EditRuleWizard.java:109)
at org.alfresco.web.bean.wizard.WizardManager.setCurrentWizard(WizardManager.java:83)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleWizardOpen(AlfrescoNavigationHandler.java:563)
at org.alfresco.web.app.AlfrescoNavigationHandler.handleNavigation(AlfrescoNavigationHandler.java:110)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Hope someone can help me.

P.S.  i'm using 1.4 RC
16 REPLIES 16

tregi
Champ in-the-making
Champ in-the-making
Regarding the posted problem, i would like to add something that maybe can help.

The situation i have is the following:

1) one space with a content rule applied. This rule is the one described above, which causes the java.lang.NullPointerException (moves a doc into another space and sends an email to a specified user)

2) another space with a simplier rule which moves only the inbound docs somewhere else in the spacestore

if i login and try to edit the first rule i get the exception. Then, i go and edit the second rule. Everything works: i can see and eventually modify it. Now i go back to the first rule and….magically i can edit it too: the exception is no longer present.

Finally, i can also see from alfresco log file that, when the first rule is fired, a message like "Failed to send mail to null" is shown; so it really seems that for some reason the application can't retrieve the email address in some occasions.

Hope i've explained it well.

Thanks in advance for your help!!!

gavinc
Champ in-the-making
Champ in-the-making
Hi,

You have indeed found a bug.

The MailHandler class used to initialise the wizard for edit is trying to access the current wizard before it's been fully initialised, hence the NullPointerException.

Once you've been into one wizard succesfully the object required has been setup which is why on your second attempt it appears to work. However, the wizard will be using the wrong object.

I have raised this in JIRA: http://issues.alfresco.com/browse/AWC-966 so you track the progress.

Thank you for reporting this.

tregi
Champ in-the-making
Champ in-the-making
Hi,

you're confirming what i supposed: something was wrong with the initialisation of the handler class.

Thanks for this and for all the rest of your work!!!!! By the way, you're doing an excellent job with this software.

P.S. : do you think it's the same bug causing the error "Failed to send mail to null" when the rule is fired?

gavinc
Champ in-the-making
Champ in-the-making
What does the rest of the stack trace say? Did you select an individual to send the email to? Does that individual have an email adrress set?

I presume you have an email server configured and running on the same machine as the alfresco repository?

heckle
Champ in-the-making
Champ in-the-making
I am having this issue on 2.0 also. I had three rules in a space, the last one being a mail rule. I got the java.lang.NullPointerException error. I restarted the tomcat server to see what would happen. I was able to delete the rule.

Is this a seperate bug?

gavinc
Champ in-the-making
Champ in-the-making
Sounds like a simialr problem, the best thing to do is raise this as an issue in JIRA.

melkor_kp
Champ in-the-making
Champ in-the-making
I obtain the same error as well with the last alfresco 2.0 release

melkor_kp
Champ in-the-making
Champ in-the-making
As I said I get a similar error, here is the complete output.
Please let me know it I am doing something wrong or is just
an Alfresco bug.



13:40:00,980 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
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)

gavinc
Champ in-the-making
Champ in-the-making
The error message in this case gives a clue "Failed to send email to null", means that for some reason there is no email address present to send to.

Can you verify that the user you are trying to send the email to has an email address set in their user preferences.