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

christian
Champ in-the-making
Champ in-the-making
hi,

I also have a problem with the email content rule. When I add only 1 or 2 users to the list erverything works fine, but if I add more I get this error

[org.alfresco.repo.action.executer.MailActionExecuter] Failed to send email to null
org.springframework.mail.MailSendException: Could not send mails: 554 Not allowed

com.sun.mail.smtp.SMTPSendFailedException: 554 Not allowed

I'm using Version: Community Network - v2.0.0

p.s.  alfresco is really great

gavinc
Champ in-the-making
Champ in-the-making
OK, I have spent some time this morning investigating these issues. It seems we have a regression for the bug http://issues.alfresco.com/browse/AWC-966 which is explained at the beginning of this thread. It seems a merge has been missed along the line somwehere and the fix applied to 1.4 has not made it into the 2.x codeline.

I have applied the fix to the enterprise branch for 2.x, this should get merged to HEAD and mirrored in the next few days. In the meantime it's a simple fix if you want to apply it your local copy.

In org.alfresco.web.bean.wizard.WizardManager in the setCurrentWizard() method move the following line before the call to wizard.init()

this.currentWizardState = new WizardState(config, wizard);

As for the other reported issues where emails are failing to get sent, there is a red herring in the exception message. Where it says "Failed to send email to null", that was caused by a mistake in the error handling.

Change the catch block in org.alfresco.repo.action.executer.MailActionExecuter to read as follows:

String to = (String)ruleAction.getParameterValue(PARAM_TO);
if (to == null)
{
   Object obj = ruleAction.getParameterValue(PARAM_TO_MANY);
   if (obj != null)
   {
      to = obj.toString();
   }
}
           
logger.error("Failed to send email to " + to, e);

You should now see that it is trying to send mail to the appropriate users/groups.

This leads me to believe that the errors are coming from the email sender itself and not Alfresco. I have been able to successfully send emails to multiple addresses and groups without error.

What email server have you guys configured in? Could you possibly test sending email with this engine in a small test harness outside of Alfresco to verify that it is working.

christian
Champ in-the-making
Champ in-the-making
Hi,

the problem was the mailserver of my provider. I was able to send mails to 3-4 users, but when I added more I got the "Failed to send email to null" message. I configured my own mailserver and now everything is working perfect.

crimson090
Champ in-the-making
Champ in-the-making
Hello,

I am still having this problem, and pardon the ignorance but I can't find either a way to fix this on my local machine (I can't find the code referred to), and don't see any mirrors with files newer than late February.

melkor_kp
Champ in-the-making
Champ in-the-making
I solved the problem without the patch.
The problem I had is common in ubuntu (I do not tried in debian ) with  spring framework. I solved the problem as follows:

edit /root/.mailcap
delete -e illegal entry


With that is working properly. This solved my error explained in this threat.
I hope this would help the rest of you.

mdo10025
Champ in-the-making
Champ in-the-making
In org.alfresco.web.bean.wizard.WizardManager in the setCurrentWizard() method move the following line before the call to wizard.init()

this.currentWizardState = new WizardState(config, wizard);

Change the catch block in org.alfresco.repo.action.executer.MailActionExecuter to read as follows:

String to = (String)ruleAction.getParameterValue(PARAM_TO);
if (to == null)
{
   Object obj = ruleAction.getParameterValue(PARAM_TO_MANY);
   if (obj != null)
   {
      to = obj.toString();
   }
}
           
logger.error("Failed to send email to " + to, e);

I've encountered this same issue and wanted to try to make this update manually but which file do I update? I'm a newbie to Alfresco and any help would be greatly appreciated.

dgarrison
Champ in-the-making
Champ in-the-making
We are having the same problem with the rules diappearing once they have been set.  We want to apply Gavins suggested fix

"I have applied the fix to the enterprise branch for 2.x, this should get merged to HEAD and mirrored in the next few days. In the meantime it's a simple fix if you want to apply it your local copy.

In org.alfresco.web.bean.wizard.WizardManager in the setCurrentWizard() method move the following line before the call to wizard.init()

Code: Select all
this.currentWizardState = new WizardState(config, wizard);


but those files appear to be compiled source code.  We do not have strong Java programming skills in house. Are we missing something simple. How do we do this?

Thanks