cancel
Showing results for 
Search instead for 
Did you mean: 

problems with invoking mail task in activiti engine

georgeflorentin
Champ in-the-making
Champ in-the-making
I'm wondering if anyone's encountered this problem. I've created a simple workflow in Activiti Designer (0.7.0) that includes a mail task. I've configured a POP3/Apache mail server (James) on my machine and my unit test of the workflow runs ok. the unit test completes and mail gets sent to the server.

However, when I deploy the workflow to the activiti engine app (v5.1) (running in Tomcat v7, JAVA_HOME points to a JDK1.6.0_20 install, same machine as where I run the unit test), starting the workflow from Activiti Explorer generates an error message about not being able to invoke the mail task. In the Tomcat log the trace below is shown. Looking around the net, this problem can be caused by a version mismatch between the mail jar the activation jar.Typical root causes have been that the activation and mail jar are being loaded by different class loaders or are incompatible versions. I've poked around in Tomcat webapp dirs and such and I don't see any obvious rogue versions of either activation*.jar or mail*.jar. I can try tweaking the Tomcat version I use, JAVA_HOME setting, try setting values in the mailcap file, etc. But before I dig deeper wondering if someone else has seen this.

thx



org.activiti.engine.ActivitiException: Could not send e-mail
   at org.activiti.engine.impl.bpmn.MailActivityBehavior.execute(MailActivityBehavior.java:61)
   at org.activiti.engine.impl.bpmn.JavaDelegateDelegate.execute(JavaDelegateDelegate.java:39)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
   at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:489)
   at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:355)
   at org.activiti.engine.impl.pvm.runtime.OutgoingExecution.take(OutgoingExecution.java:38)
   at org.activiti.engine.impl.runtime.ExecutionEntity.takeAll(ExecutionEntity.java:474)
   at org.activiti.engine.impl.bpmn.ParallelGatewayActivity.execute(ParallelGatewayActivity.java:72)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
   at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:489)
   at org.activiti.engine.impl.runtime.ExecutionEntity.start(ExecutionEntity.java:285)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:66)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:65)
   at org.activiti.rest.api.process.ProcessInstancePost.executeWebScript(ProcessInstancePost.java:45)
   at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:76)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : localhost:25
   at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242)
   at org.apache.commons.mail.Email.send(Email.java:1267)
   at org.activiti.engine.impl.bpmn.MailActivityBehavior.execute(MailActivityBehavior.java:59)
   … 39 more
Caused by: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: IOException while sending message (javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="—-=_Part_0_2817581.1297118398574"))
   at javax.mail.Transport.send(Transport.java:163)
   at javax.mail.Transport.send(Transport.java:48)
   at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232)
   … 41 more
Caused by: javax.mail.MessagingException: IOException while sending message (javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="—-=_Part_0_2817581.1297118398574")
   at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
   at javax.mail.Transport.send(Transport.java:95)
   … 43 more
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="—-=_Part_0_2817581.1297118398574"
   at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
   at javax.activation.DataHandler.writeTo(Unknown Source)
   at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1142)
   at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
   … 44 more
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Can't say I have seen that exception message before …

Could you try weith 5.2 ? I changed some bits around mailing in the demo setup since I had some issue there, too (but not similar o yours)

georgeflorentin
Champ in-the-making
Champ in-the-making
Yup, I'm going to move over to a new dev environment today and I'll setup 5.2 and report on how things go.

Thx.

georgeflorentin
Champ in-the-making
Champ in-the-making
Ok, this is now working. Details: I installed Activiti 5.2 into a new development environment (using Spring Source Tool Suite instead of Eclipse Helios, Win2008 R2 instead of Win2003 R2), re-installed my Activiti project and the deployment to the Activiti Engine worked ok and I can run the workflow that includes a mail task ok. So lots of things changed, not sure what the culprit was in my environment. But happy to be unblocked…

jbarrez
Star Contributor
Star Contributor
Great to hear!

For me, the problem was that there was a geronomo-mail.jar on my classpath which screwed with my mail sending. I removed this jar as a dependency in the latest release.